Can I use the SDK Compiler in 2015a with a version of Java that didn't come with MATLAB?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
ZBMedina
2016년 3월 29일
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.
답변 (1개)
Harsheel
2015년 12월 7일
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
Harsheel
2015년 12월 8일
Unfortunately, this is currently not supported. You need to exactly have JDK 1.7.0_60.
참고 항목
카테고리
Help Center 및 File Exchange에서 Java Package Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!