(noob) Matlab Compiler Issue

조회 수: 2 (최근 30일)
Peter Cook
Peter Cook 2015년 6월 19일
댓글: Peter Cook 2015년 6월 23일
Hey folks,
I am trying to build an m-file (sans GUI) into a standalone application for colleagues to utilize.
Unfortunately, the compiler immediately exits in error when I hit Package. here is the packagingLog:
<mkdir dir="C:\Users\hb69954\Documents\MATLAB\kairos\SugaredOwl\for_redistribution" />
<mkdir dir="C:\Users\hb69954\Documents\MATLAB\kairos\SugaredOwl\for_testing" />
<mkdir dir="C:\Users\hb69954\Documents\MATLAB\kairos\SugaredOwl\for_redistribution_files_only" />
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/Project
at com.mathworks.project.impl.engine.AntEntryPoint.main(AntEntryPoint.java:21)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Project
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
My assumption here is I am missing a java library, could anyone point me in the right direction?

채택된 답변

Gitesh Nandre
Gitesh Nandre 2015년 6월 22일
편집: Gitesh Nandre 2015년 6월 22일
The "NoClassDefFoundError" error is thrown because MATLAB is not able to locate Java Runtime libraries that are used by the MATLAB Compiler SDK.
There are several possible causes to this issue:
A. The installation is corrupted and there are .jar files missing from the MATLAB installation folder.
B. The classpath.txt file is missing references to Java Runtime libraries.
1. To take a look at the MATLAB search path, execute "pathtool" in the Command Window. This will open up the Set Path window with the list of folders that MATLAB parses. The start-up folder should be at the top.
You can try to restore the search path to the installation default by executing the following commands:
>> restoredefaultpath
>> rehash toolboxcache
However, this will not remove the start-up directory from the MATLAB search path. If the start-up folder contains M-files, try to remove them or move them to another folder which is not on the search path.
2. If the issue still persists, the installation might be corrupted. Remove MATLAB completely and install it again to resolve the issue.
  댓글 수: 1
Peter Cook
Peter Cook 2015년 6월 23일
A full un-install/re-install fixed the issue. I believe this issue may have been due to not having the correct JDK (Java 1.6.0_60-b19) installed at the time I installed MATLAB R2015a.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)


Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by