Can I use the SDK Compiler in 2015a with a version of Java that didn't come with MATLAB?
1 view (last 30 days)
Show older comments
I would like to wrap my MATLAB code into a Java class using the MATLAB Compiler SDK. MATLAB version 2015a is shipped with an older version of Java - more specifically Java 1.7.0_60. I downloaded and installed Java 1.7.0_60 and then configured my Java environment and was able to successfully generate a .jar file. However, it turns out that Java 1.8.0_66 is the only version of Java approved to be on my computer.
I tried adding a MATLAB_JAVA environment variable as described here: http://www.mathworks.com/matlabcentral/answers/130359-how-do-i-change-the-java-virtual-machine-jvm-that-matlab-is-using-on-windows and pointed it to the following directory: C:\Program Files\Java\jre1.8.0_66. However, when I open MATLAB I see many errors caused by java.lang.RuntimeException: XPathFactory#newInstance().... Additionally, when I go to select Library Compiler from Apps, the content within the window never loads.
Is there a potential work-around here? Is it possible to set MATLAB_JAVA to point to a newer version of Java without compromising the use of the SDK Compiler?
1 Comment
ZBMedina
on 29 Mar 2016
I'm having the same problem with Matlab 2015b and JDK 1.8. Older version of JDK are no longer approved on any PC on the network. Please let me know if you have found a solution.
Answers (1)
Harsheel
on 7 Dec 2015
What you are doing is changing the JAVA version for MATLAB and all the toolboxes. You don't need to do that, revert this change.
For Compiler SDK, create an environment variable JAVA_HOME and set it to the JDK path. What you have installed is JRE. Please install the JDK. For example, JAVA_HOME will look like:
C:\Program Files\Java\jdk1.7.0_60
This will ensure that Compiler SDK uses JDK 1.7 to convert the .m files into .jar files. Meanwhile, MATLAB and other products will continue to use JRE 7 that is shipped with MATLAB.
2 Comments
Harsheel
on 8 Dec 2015
Unfortunately, this is currently not supported. You need to exactly have JDK 1.7.0_60.
See Also
Categories
Find more on Java Package Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!