Java version mismatch

Hi Experts,

Need an urgent solution,

I had updated the solaris recent pacakges in one of the server having Java apps, those patches include the Java fixes too, after the patch the apps are not getting started and throw the following errors.  I will be pleased to have your help. the current Java version is 1.5.

[Loaded java.lang.UnsupportedClassVersionError from /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar]
[Loaded sun.misc.ClassFileTransformer from /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar]
[Loaded java.io.IOException from /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar]
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)
[Loaded java.lang.Shutdown from /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar]
[Loaded java.lang.Shutdown$Lock from /usr/jdk/instances/jdk1.5.0/jre/lib/rt.jar]


LVL 10
BawerAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:
Why would you want to install 1.5 ? Wahtever was compiled with 1.6 should be running on 1.6. Whatever was compiled with 1.5 will also run on 1.6. Why not to run everything on 1.6 ?
0
 
chaitu chaituCommented:
try to install 1.5 version again.
0
 
BawerAuthor Commented:
actually some how some misunderstanding has been developed between vendor of app and us, the apps are compiled with 1.6 and we are installing 1.5 now coming back to 1.6 and after re installation still the java -version is showing the 1.5
0
 
Frank ContrepoisVP Technical SalesCommented:
You or the dev team probably complie the files with java 1.6 as the target version.

Recompile with 1.5 it's generally simpler to do than to upgrade java to 1.6 on the server side
0
 
BawerAuthor Commented:
upgraded the version to 1.6 and compiled the problematic app with higher version.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.