问题
i am trying to change the default JVM from matlab but it didn't work.
>> !java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
>> !/usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.8.0_25, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
1.6.0_65-b14-468, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
>> !export JAVA_HOME=`/usr/libexec/java_home -v 1.6.0_65-b14-468`
>> !java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
i am doing this because the MCC command doesn't work with java 1.8.
what i have to do to change the default JVM? iam working on OS X 10.10.3 with Matlab r2011a
thanks
回答1:
Matlab is shipped with its own version of JVM and does not respect JAVA_HOME
environmental variable. Instead, you need to create MATLAB_JAVA
environmental variable, set it to JRE/JDK directory, and then start Matlab.
来源:https://stackoverflow.com/questions/36970686/change-the-default-jvm-version-in-matlab