Stanley Mungai
Stanley Mungai

Reputation: 4150

java.lang.UnsupportedClassVersionError on AIX

I have Compiled a jar file using JDK 1.6.0 to match the java version in the server. And when I execute java -jar Myjarfile.jar the programs runs well. I have then set up a Cron Job to execute the same file and now I am getting UnsupportedClassVersionError in my /var/spool/mail/username and of course the jar file is not executing using cron job. I find this very strange. I have run out of reasons as to why this would happen. What else should I check?

UPDATE: I have checked JAVA_HOME s set correctly

Upvotes: 2

Views: 146

Answers (1)

Harshit
Harshit

Reputation: 1293

As already pointed out in the comments.. java runtime being picked up is lower than your compiled jdk version. (difficult to point to the exact reason why it is being picked from the info given above).

What you could do is provide the absolute jdk path in your cron command.. i.e. inplace of just java -jar Myjarfile.jar, provide something like

/usr/lib/jdk6/../java -jar Myjarfile.jar.

Upvotes: 2

Related Questions