First i am a total novice at linux so dont hate. I have done the same thing on windows may times and always gotten it to work. Trying on a linux box for the first time.
1)I have installed Glassfish 4 which needs JDK7 or higher.
2)I installed JDK 8
3)I set JAVA_HOME to the JDK
4)I unziped Glassfish.
When i run the following
glassfish4/bin/asadmin
I get the following error
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
What to do.
I have seen this before and solution has been to set the JDK path. But i cant find anywhere where i am to set the path. asenv.conf
?
Looks like your default system java is in old version. You can check it by running:
$ java -version
To set specific Java for Glassfish open glassfish/config/asenv.conf file and add at the end folowing:
AS_JAVA=pathToYourJavaHomeFolder
Super thanksto @EvanKnowles.
Solution:
1) Downloaded Solaris Sparc version of JDK 7
Thats it folks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.