fix for javax.media.opengl.GLException: java.lang.reflect

User 9431187277

25-01-2007 22:22:51

You may want to try work-around below to use a pre-1.5 version of java if your MarvinSpace crashes with GLException traceback similar to below:





C:\Program Files\ChemAxon\MarvinBeans\bin>mspace.bat


Exception in thread "main" javax.media.opengl.GLException: java.lang.reflect.InvocationTargetException


at javax.media.opengl.GLCanvas.disableBackgroundErase(GLCanvas.java:352)


at javax.media.opengl.GLCanvas.addNotify(GLCanvas.java:154)


...





DETAILS...


(Windows xp-sp2,


I'm using newest current stable MarvinSpace that came with this file:


12,722,176-byte marvinbeans-4_1_5-windows.exe





Some hits on google suggested updating video-card driver, which I tried but that did not help. But 2 other hits on google (below) hinted that java


versions before 1.5 did not have the problem:





http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1165240481


http://processing.org/discourse/yabb_beta/YaBB.cgi?board=OpenGL;action=display;num=1166986458





Since I still also had a pre-1.5 version, I was able to get Marvin-space to run ok as shown using 4 steps below. A better way to fix may be available, but it worked for me.





Step 1. See if you have a java older than jre1.5 by looking in:


(Newer java installs generally do not remove earlier ones).


Directory of C:\Program Files\Java





07/31/2006 01:00 PM <DIR> j2re1.4.2_04


07/27/2004 12:27 PM <DIR> j2re1.4.2_05


08/10/2006 01:09 PM <DIR> jre1.5.0_06


12/08/2006 07:03 PM <DIR> jre1.5.0_09


01/10/2007 10:21 AM <DIR> jre1.5.0_10





Step 2. In this case, I found a pre-1.5 "java.exe" in the j2re1.4.2_05\bin folder. (The command "java -version" will verify version).





Step 3. No go to C:\Program Files\ChemAxon\MarvinBeans\bin


and make a backup-copy of the original mspace.bat file.





Step 4. Use NOTEPAD (or favorite editor, but NOT word) to edit MSPACE.BAT file, and at the bottom insert lines similar to following:





REM ----- Force use of pre-1.5 java as work-around for


REM ---- javax.media.opengl.GLException


set JVMPATH="C:\Progra~1\Java\j2re1.4.2_05\bin\java"





YOU'LL NEED TO USE THE ACTUAL PATH to a pre-1.5 java ON YOUR PARTICULAR PC. I PUT THE LINES JUST BEFORE java runs as shown in exerpt below





***clip***


REM ---------------- End of Marvin batch header -----------------------------





if ()==(%JVM_X_PARAM%) set JVMPARAM=%JVMPARAM% -Xmx128m





REM ----- Force use of pre-1.5 java as work-around for


REM ---- javax.media.opengl.GLException


set JVMPATH="C:\Progra~1\Java\j2re1.4.2_05\bin\java"





"%JVMPATH%" %JVMPARAM% chemaxon.marvin.space.gui.MSpace %1 %2 %3 %4 %5 %6 %7 %8 %9





REM ----------------- Begin of Marvin batch footer --------------------------


***clip***





I'm not sure how to get the MarvinSpace.exe wrapper to run the older java... If you want an icon on desktop or menus, right-click on the working mspace.bat file and "send to desktop". That is, with this work-around, you'll need to run it by clicking on the Mspace.bat (not by clicking on the nice blue icon).


ChemAxon 909aee4527

26-01-2007 09:02:32

Hello billday,





thank you for the valuable post!





We noticed that on Windows MarvinSpace does not work with Java 1.5_10.


This is the only version that causes problem, switching to another Java e.g. 1.5_09 or 1.6 works this out.





After some more testing, we intend to use a newer verson of Jogl to solve this.





The used Java can be set globally in Java Control Panel too, but this affects other applications as well.