mxj: could not find Java 2 Runtime Environment and mxj_platform_init failed
Hello everybody!
I've been struggling for a while trying to get my leapmotion to work with Max 6 on a Windows 8.1 computer. So far, no success. ManosOSC for some reason won't even load. leapformax.com didn't work. o.io.leap object didn't work (probably because it was for Mac, although I wasn't able to confirm).
With the help of a friend I found this website http://www.hfmdd.de/hochschule/institute/studio-fuer-elektronische-br-musik/projekte/leapmotion-mxj/
Didn't understand the german, but the instructions were in english. I followed the instructions and I got really far! THE ONLY problem:
the object mxj semd.leapmotion wasn't working. The error message I got:
mxj: could not find Java 2 Runtime Environment.
Error loading:
(mxj) mxj_platform_init failed. Could not initialize the Java Runtime Environment.
Please check your Java installation. http://java.sun.com
Unable to create JVM
I searched online found this:
https://cycling74.com/forums/unable-to-create-jvm-2/ and
https://cycling74.com/forums/mxjcould-not-find-java-2-runtime-environment/
Both somewhat helpful. The idea: to use 32bit Java. I uninstalled all of Java and installe donly 32 bit and this did not solve the problem.
I'm losing my hair! Could someone please help?
Thanks a lot.
Best,
appleslice
Does Java work at all? What does
java -version
in a console report?
When I typed that in command prompt I received this message:
' java' is not recognized as an internal or external command, operable program or batch file.
Then I went to control panel, went to the uninstall/repair part and found Java and it told me the version I had was 1.7.0
So I do have Java. Command prompt doesn't think so though. What does this mean? That Java didn't install properly? Everytime I install the same thing happens.
Update: So, the sensing of the leap motion works on Max 5 using the mxj semd.leapmotion. However, Max 6 is where the issue is found. I've been messing around, but still no success. Could someone please help?
Do the other mxj externals in Max 6 work? Try [mxj net.maxhole] object for example.
If it does not, look up your max JVM settings:
\Max 6.1\Cycling '74\java\max.java.config
Compare the settings line-by-line to your working Max 5 distribution. The available options should be the same.
Regards,
Christoph
Thank you for taking the time to help me out.
I checked the code and it read the same except the file on Max6.1 had a few more comments about copyright.
It took me long enough to realize that I was using the 64bit version of Max. Once I installed the 32bit version the mxj externals seemed to work because they were not shaded in dark gray.
Get this, once I did everything in your installation txt file, every time I opened the semdd.leapmotion help file Max would shut down completely with no error message. Disk Usage on the computer would go to 100% unless I ended the task with task manager. I did some troubleshooting and found out that max 6 would only shut down when I had the leapjava.jar in cycling74/java/lib. If I deleted the file, I was able to load the help file with the following error message:
java.lang.NoClassDefFoundError: com/leapmotion/leap/Controller
at semdd.leapmotion.(leapmotion.java:44)
(mxj) unable to construct instance of semdd.leapmotion
Any ideas of what to do next?
Thanks.
To clarify what the notepad files say:
Max 5 max.java.config reads:
; This is the config used by Max when instantiating the JVM ;
; Comments are enclosed within 2 semicolons ;
; The file format is relatively fragile so pay attention ;
; when editing this file !! ;
; some example options one may use ;
; add all jars in /Users/topher/java/lib to the system classpath i.e. immutable classpath ;
; max.system.jar.dir /Users/topher/java/lib;
; add /Users/topher/foo to the system classpath i.e. immutable classpath ;
; max.system.class.dir /Users/topher/foo ;
; these next 2 are typically what you would want to use if you want additional directories ;
; added to your classpath for max ;
; add /Users/topher/myclasses to the dynamic classpath of MXJClassLoader ;
; max.dynamic.class.dir /Users/topher/myclasses ;
; add all jars in /Users/topher/myjars to the dynamic classpath of MXJClassLoader ;
;max.dynamic.jar.dir /Users/topher/myjars ;
; specify some jvm options ;
max.jvm.option -Xincgc
max.jvm.option -Xms64m
max.jvm.option -Xmx256m
; uncomment these options(i.e. remove surrounding semi colons ;
; to cause the JVM to be created ;
; in debug mode and listening for remote debugger connections ;
; on port 8074. This would enable you to interactively debug ;
; your mxj code using JDB or some other debugger which supports ;
; the JDI wire protocol ;
; max.jvm.option -Xdebug ;
; max.jvm.option -Xnoagent ;
; max.jvm.option -Xrunjdwp:transport=dt_socket\,address=8074\,server=y\,suspend=n ;
; max.jvm.option -XX:-UseSharedSpaces ;
Max 6.1 max.java.config reads:
; ;
; Permission is hereby granted, free of charge, to any person obtaining a copy of this software ;
; and associated documentation files (the "Software"), to deal in the Software without restriction, ;
; including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, ;
; and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, ;
; subject to the following conditions: ;
; ;
; The above copyright notice and this permission notice shall be included in all copies ;
; or substantial portions of the Software. ;
; ;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, ;
; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ;
; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ;
; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ;
; OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ;
; This is the config used by Max when instantiating the JVM ;
; Comments are enclosed within 2 semicolons ;
; The file format is relatively fragile so pay attention ;
; when editing this file !! ;
; some example options one may use ;
; add all jars in /Users/topher/java/lib to the system classpath i.e. immutable classpath ;
; max.system.jar.dir /Users/topher/java/lib;
; add /Users/topher/foo to the system classpath i.e. immutable classpath ;
; max.system.class.dir /Users/topher/foo ;
; these next 2 are typically what you would want to use if you want additional directories ;
; added to your classpath for max ;
; add /Users/topher/myclasses to the dynamic classpath of MXJClassLoader ;
; max.dynamic.class.dir /Users/topher/myclasses ;
; add all jars in /Users/topher/myjars to the dynamic classpath of MXJClassLoader ;
;max.dynamic.jar.dir /Users/topher/myjars ;
; specify some jvm options ;
max.jvm.option -Xincgc
max.jvm.option -Xms64m
max.jvm.option -Xmx256m
; uncomment these options(i.e. remove surrounding semi colons ;
; to cause the JVM to be created ;
; in debug mode and listening for remote debugger connections ;
; on port 8074. This would enable you to interactively debug ;
; your mxj code using JDB or some other debugger which supports ;
; the JDI wire protocol ;
; max.jvm.option -Xdebug ;
; max.jvm.option -Xnoagent ;
; max.jvm.option -Xrunjdwp:transport=dt_socket\,address=8074\,server=y\,suspend=n ;
; max.jvm.option -XX:-UseSharedSpaces ;
; 1 = compatible mode (default in 64bit) ;
; 2 = hi performance mode (default in 32bit) ;
; hi performance mode for 64 bit is only supported with a JavaVM > 6u33 (where -XX:+UseCompressedOops is default) ;
; mxj.msp.mode 2 ;
any luck w/ this? i'm also getting failures after installing java 1.7.0_55 on win7 and restarting max. here are my specs:
{
"version" : "Version 6.1.7 (e5b6090)",
"platform" : "windows",
"arch" : "x86",
"osversion" : "Microsoft Windows 7 Professional Service Pack 1 (build 7601), 64-bit",
"samplerate" : 44100,
"iovs" : 512,
"sigvs" : 64,
"scheduler_in_audio_interrupt" : "off",
"audio_drivername" : "ad_mme",
"audio_driver_subname" : "",
"eventinterval" : 1,
"overdrive" : "off",
"mixerparallel" : "off",
"mixercrossfade" : 0,
"mixerlatency" : 30.0,
"mixerramptime" : 10.0,
"packages" : {
"vizzie" : {
"name" : "vizzie"
}
}
}
Hmm. I've been trying to fix it with no luck still. Does anyone have any other ideas? Could this be a straight up Java compatibility issue with Windows 8.1 ?
I am also running into this problem. Could someone from cycling please let us know if mxj (java) works with windows 8.1 with the latest version of java installed?
On win 8.1 "Windows x86 Offline 29.02 MB jre-8u31-windows-i586.exe"seems to work for me (Max 7 32bit): http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Remember: x86 = 32bit, x64 = 64bit
So I have the definitive answer on this, having run into this issue a few times. Here we go: if mxj is not working on your machine and you swear you've got Java installed, it's because there's a mismatch in the architecture. If you are running 64-bit Max, you need to specifically- specifically!- find the 64-bit java download. If you're running 32-bit Max, you also need to check that you have downloaded the correct one. This issue has now confounded me three times, and I am writing this note primarily to remind myself to not be such a freaking dumbass.
Thanks Joshua, had this problem and didn't even think about it being a problem with the 64bit Max! Now everything is working as it should!
Joshua, forgive me if this is an obvious question, but how do you point max to your 64-bit JVM? As in what is the actual line you change in your max.java.config.txt??
Hey,
I came to this issue today after installing Corretto 8 (AWS' OpenJDK build). There isn't much information out there so this is how I sorted it out:
My Corretto dir is C:\Opt\JDK but you can use whatever. Download Corretto in .zip and uncompress it. Then download the attached registry patch (.reg) and apply it by double clicking on it. Note that if you put the JDK into a different folder, you'll have to modify the .reg file accordingly.
Works as intended in windows 10/1903 and it should be backwards compatible to at least Windows 7.