Above are very good and complete method. and they are from website 2 day geek
Install java :
- Download jdk tar from oracle website , and uncompress it to a filefolder (such as /opt)
- set environment variables for java. there are three methods.
- system wide. edit /etc/profile or create a new *.sh in /etc/profile.d/(this method is better). then edit java.sh as below.
then save the .sh file and run command "source /etc/proflile"
- export JAVA_HOME=/opt/jdk1.8.0_60
- export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
- export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
- single user . edit .bashrc (which is in ~/). we can use export just as above . or use alias as below
then save file .bashrc and run command "source ~/.bashrc"
- alias java=/opt/jdk1.8.0_60/bin/java
- alias javac=.....
- just in this session. just use export as above.
No comments:
Post a Comment