开发者

java version in linux

开发者 https://www.devze.com 2022-12-18 08:02 出处:网络
# which java /usr/bin/which: no java in (/usr/local/jdk/jdk1.5.0_10/bin/java:/开发者_运维技巧usr/local/jdk/jdk1.5.0_10/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bi
# which java
/usr/bin/which: no java in (/usr/local/jdk/jdk1.5.0_10/bin/java:/开发者_运维技巧usr/local/jdk/jdk1.5.0_10/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin)

I installed java in /usr/local/jdk/jdk1.5.0_10 but cannot run java -version

I get this

$ java -version
-bash: /usr/bin/java: No such file or directory

this is red hat linux


It's not in your path.

use

export PATH=$PATH:/usr/local/jdk/jdk1.5.0_10/bin

export JAVA_HOME=/usr/local/jdk/jdk1.5.0_10

Look at ~/.bash_profile for where to define this permanatly.


Can you do ls /usr/local/jdk/jdk1.5.0_10/bin And why is /usr/local/jdk/jdk1.5.0_10/bin/java in your path?


Must be in local path of java before running to see what version is installed. Use find / -name java (this will list anything with java on the server copy the path ). path should end with..../jre/bin/java copy full path.

Open Java location of the path you copied above, remove java at the end you path then enter, Enter command below:
./Java -Version

0

精彩评论

暂无评论...
验证码 换一张
取 消