java - Running a jar from shell script -
I have a jar file named umar.jar in the root / umar / bin directory. I have a shell script file run.sh in the same directory. The following is the contents of the.
#! / Bin / bash "$ JAVA_HOME" / bin / java -jar /root/umar/bin/umar.jar
Now when I run the shell script, I get the following error < / P>
Exceptions in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in the .class file Now it is strange, if I run this command directly on the shell
java -jar umar.jar
Works perfectly fine. If the jar was compiled with a later version of JDK compared to my JRE, then it should not have gone from the shell too.
What do you suggest?
Comparison "Java-version" and "$ JAVA_HOME" / bin / java -version "
You have multiple JVM installed
Comments
Post a Comment