java.lang.UnsupportedClassVersionError: Bad version number

User ccd7c37680

20-05-2011 02:35:32


java.lang.UnsupportedClassVersionError: Bad version number in .class file


at java.lang.ClassLoader.defineClass1(Native Method)


at java.lang.ClassLoader.defineClass(ClassLoader.java:676)


at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)


at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)


at java.net.URLClassLoader.access$100(URLClassLoader.java:56)


at java.net.URLClassLoader$1.run(URLClassLoader.java:195)


at java.security.AccessController.doPrivileged(Native Method)


at java.net.URLClassLoader.findClass(URLClassLoader.java:188)


at java.lang.ClassLoader.loadClass(ClassLoader.java:317)


at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)


at java.lang.ClassLoader.loadClass(ClassLoader.java:307)


at java.lang.ClassLoader.loadClass(ClassLoader.java:252)


at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)


at com.install4j.runtime.MacLauncher.main(Unknown Source)


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)


at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


at java.lang.reflect.Method.invoke(Method.java:592)


at apple.launcher.LaunchRunner.run(LaunchRunner.java:116)


at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)


at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)




Why do I get this error???

ChemAxon 7c2d26e5cf

20-05-2011 08:58:45

I assume you have tried to launch a desktop Marvin application that Marvin 5.5 OS X installer setup and your default Java version is still 1.5.


Can you confirm this? Which operating system you have?


The error message says that your Java version is lower than the required one.


Since Marvin 5.5, all Marvin tool requires Java 1.6 (or higher version), see  the documentation: System requirements.


Please upgrade your default Java version to 1.6.

User ccd7c37680

21-05-2011 18:37:01

I am using Mac 10.5.8 and my java version is currently 1.6.0_24 as confirmed by checking terminal, and yes i was reffering to the application on my desktop from the marvin installer.

ChemAxon 7c2d26e5cf

23-05-2011 09:43:45

Attempt launching MarvinSketch through the msketch script from the bin directory of the Marvin Beans package (in a terminal window):


/Applications/ChemAxon/MarvinBeans/bin/msketch


Does it work for you?


If Java 1.6 is your default, the msketch script will prefer this one.


With the Java Preferences application, you can also check which Java versions are available on your machine.


/Applications/Utilities/Java Preferences

User ccd7c37680

23-05-2011 19:22:34

That did work!!! 


 


is there any way I can make it so i can just directly open the application?

ChemAxon 7c2d26e5cf

25-05-2011 14:58:22

We are still checking why desktop launcher does not use Java 1.6.

ChemAxon 7c2d26e5cf

31-05-2011 12:10:31

Although Java 1.6 is the default on your machine but it is a 64bit implementation. It seems that current OS X installer only accepts 32bit Java implementations.


Unfortunately, Apple does not provide the 32bit implementation of Java 1.6 for OS X 10.5. Apple has implemented it only for OS X 10.6.


Thus, it is an OS X 1.5 specific issue. Under the recent OS X platform (10.6), Marvin OS X installer can incorporate with the 32bit Java 1.6. So Marvin 5.5 can be installed to this platform without any issue.


We are still checking how to improve our OS X installer to accept also 64bit Java.


Until then, please use the cross platform package of Marvin Beans (marvinbeans-VERSION.zip) on OS X 10.5. It is uses the default Java to launch Marvin applications.
If there is any Java 1.6 on your machine and this is the default one, Marvin applications will work. 

User 870ab5b546

31-05-2011 16:05:02

Interesting.  When I tried to launch MarvinSketch 5.5 this way from the terminal window, and I was in my home directory, I got this error message:


Grossman-CP-339-iMac-2:~ Bob$ /Applications/ChemAxon/MarvinBeans\ 5.5.0.1/bin/msketch
usage: dirname path
Exception in thread "main" java.lang.NoClassDefFoundError: chemaxon/marvin/Sketch
Caused by: java.lang.ClassNotFoundException: chemaxon.marvin.Sketch
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

But when I moved to the /Applications/ChemAxon/MarvinBeans\ 5.5.0.1/bin directory, it launched fine.


This discussion is relevant to the current one.  You can use the 64-bit version of the browser iCab 4.8 to run the MarvinSketch 5.5 applet on MacOS 10.5.8.  AFAIK, no other browser for MacOS 10.5 exists in a 64-bit version, and there is no version of Java 1.6 for MacOS 10.5 that is compatible with a 32-bit browser.

ChemAxon 7c2d26e5cf

01-06-2011 08:51:10

It seems that the msketch script does not accept space in the path. When you launch the script, it detects its own location (with the help of dirname command). It is needed to detect the absoulte path of MarvinBeans.jar. Set this path into the classpath of the java statement to launch the sketcher. The path includes space that the script can not handle properly.


We will debug it. Until then, remove space from the MarvinBeans directory name.

User 870ab5b546

01-06-2011 13:36:58

Thanks, that worked.

ChemAxon 7c2d26e5cf

01-06-2011 13:55:03

I have found the bug in the script. The mypath variable has not been enclosed by quotation marks.


Wrong:


dir=`/usr/bin/dirname $mypath`;

 Good:


dir=`/usr/bin/dirname "$mypath"`;


Please, update the line #41 in the msketch script like this.


In the next release, scripts will be fixed.