Page 1 of 1

java environnement

Posted: 2018/03/07 09:01:16
by souad
Hello,
I installed "jdk-7u67-linux-x64.tar.gz" on centos 6.6 by this commands:
[slave@localhost Downloads]$ ls
jdk-7u67-linux-x64.tar.gz
[slave@localhost Downloads]$ tar zxf jdk-7u67-linux-x64.tar.gz
[slave@localhost Downloads]$ ls
jdk1.7.0_67 jdk-7u67-linux-x64.tar.gz
[slave@localhost Downloads]$ su
Password:
[root@Shadoop Downloads]# mv jdk1.7.0_67 /usr/local
[root@Shadoop Downloads]# cd /usr/local
[root@Shadoop local]# ls
bin etc games include jdk1.7.0_67 lib lib64 libexec sbin share src
[root@Shadoop local]# ln -s /usr/local/jdk1.7.0_67 /usr/local/java
[root@Shadoop local]# exit
exit
[slave@localhost Downloads]$ java -version
bash: java: command not found
[slave@localhost Downloads]$ export PATH=$PATH:/usr/local/java/bin
[slave@localhost Downloads]$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
sudo update-alternatives –install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_67/bin/java" 1

when I close the terminal java -version don't work :(
I need to modify the /etc/profile but I don't know how. Ive tried some solutions but didn't work with me.
please help.
thank you

Re: java environnement

Posted: 2018/03/07 09:30:02
by TrevorH
So, from this, we gather that you really really like using ancient out of date software?

No-one should use CentOS 6.6. It came out in October 2014 so is heading towards 4 years old. There have been numerous high severity security vulnerabilities discovered and fixed since then. You should yum update to 6.9 plus the latest updates ASAP.

In addition, I went looking for the date that java 7u67 was released and that's similarly ancient. I couldn't actually download it without creating an Oracle account but I did find the following text on the Oracle web site: "This JRE (version 7u67) will expire with the release of the next critical patch update scheduled for October 14, 2014." which means that 7u67 is even older than the CentOS 6.6 you're trying to use.

All of java 7 is EOL and should not be used.

I'd recommend the following:

1) yum update to CentOS 6.9
2) download and install the latest java 8 jdk *RPM* package and install that with yum
3) use the alternatives command to set /usr/java/latest/bin/java and javac as your active java and javac commands respectively

Re: java environnement

Posted: 2018/03/11 14:46:13
by aks
Look at the alternatives subsystem (man alternatives as a starting point).