Help needed to run simple java program in linux
Hi guys ,
This is the first time i m running java application inside linux. i have installed jdk-6u20-linux-i586-rpm.bin jre-6u20-linux-i586-rpm.bin in my linux machine. and set JAVA_HOME and JRE_HOME variables respectively. Quote:
Quote:
but not able to run the program by doing java helloworld. It is giving me following error. Quote:
Quote:
|
I think /usr/bin/java is not poited to /usr/java/jdk1.6.0_20/bin/java
It is pointed to some other java (which i m not sure). How do i change this pointing? If i do the changes will it have any serious impact ? |
Why not use a package meant for your OS ? EL5 or CentOS 5.x ?
(Please add info about the Linux used, for every question.!) This package, jdk-1.6.0_20-fcs.i586.rpm is for all el5, and was created by "CERN Scientific Linux" http://ftp.scientificlinux.org/linux...0-fcs.i586.rpm http://ftp.scientificlinux.org/linux/scientific/54 The command : 'java -version' will tell which setup you have. The version can be changed with the commands : 1) su 2) /usr/sbin/update-alternatives --config java (But the rpm package install will usually do the setup.) .. EDIT /sbin/... to /usr/sbin/... |
Quote:
Quote:
|
Quote:
and just setup JAVA_HOME path in /etc/profile as JAVA_HOME = /usr/java/jdk-1.6.0_20 |
Quote:
|
The error here is NoclassDefFound
Go to the directory where you helloworld.java is present. execute Code:
javac helloworld.java Now do Code:
java --classpath . helloworld |
Sorry ... it's /usr/sbin/
... Continued in this parallel pinga123 thread .. http://www.linuxquestions.org/questi...nd-jre-806269/ .. |
All times are GMT -5. The time now is 05:26 PM. |