Need help changing Java Version in R2013b
4 views (last 30 days)
Show older comments
Computer: Macbook pro with OSX 10.8.5
I am trying to run some java code from inside Matlab, but it is painfully slow and I believe it is because the code is compiled with Java 1.6 but Matlab is running 1.7.
Inside Matlab: version -java returns: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode
From terminal: java -version returns: java version "1.6.0_51" Java™ SE Runtime Environment (build 1.6.0_51-b11-457-11M4509) Java HotSpot™ 64-Bit Server VM (build 20.51-b01-457, mixed mode)
Warning: Unable to find Java library: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/server/libjvm.dylib Please check if you have a MATLAB_JAVA environment variable. Note that MATLAB requires Java version 1.4 or higher. Warning: Disabling Java support
I have set the MATLAB_JAVA variable to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home which both maven and eclipse pick us as the home directory for the Java 1.6 jre. The file listed as missing above (libjvm.dylib) is located in /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries but even if I make the path Matlab is looking for as a soft link, I get an error about mismatched architecture but they are both 64 bit.
It seems to me like Matlab is expecting a directory structure that is different than my jre is providing, but other programs seem fine with it.
Any suggestions on what to do would be very helpful. Right now the code that I am running runs 4x slower in Matlab 2013b on my computer than it does on an identical computer a colleague has with Matlab 2010a on it because his uses the 1.6 jre.
0 Comments
Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!