I have made a jar file which i tested in windows and it works fine. now i want to test it for red hat enterprise linux 5. but i dont know how to run jar files in rhel5.
i've tried java -jar My.jar
but it says bash: java: command not found
. i've set JAVA_HOME
variable as export JAVA_HOME=/root/jdk1.6.0_21
but still not working.
can anybody tell me how to run jar file in rhel5?
You need to set
PATH
variable , something likereplace
/usr/java/jdk1.5.0_07/bin
with path to yourjdk's bin
directory.The problem is your terminal tries to find
java
command from thePATH
, but it couldn't find it.Update:
Next setup PATH / JAVA_PATH variables as follows: