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
PATHvariable , something likereplace
/usr/java/jdk1.5.0_07/binwith path to yourjdk's bindirectory.The problem is your terminal tries to find
javacommand from thePATH, but it couldn't find it.Update:
Next setup PATH / JAVA_PATH variables as follows: