Sunday, October 18, 2015

set up eclipse && java on ubuntu

Above are very good and complete method. and they are from website 2 day geek



Install java :

  1. Download jdk tar from oracle website , and uncompress it to a filefolder (such as /opt)
  2. 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.  
  1. export JAVA_HOME=/opt/jdk1.8.0_60 
  2. export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
  3. export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
          then save the .sh file and run command "source /etc/proflile"
  • single user . edit .bashrc (which is in ~/). we can use export just as above . or use alias as below
  1. alias java=/opt/jdk1.8.0_60/bin/java
  2. alias javac=.....
          then save file .bashrc and run command "source ~/.bashrc"
  • just in this session. just use export as above.




No comments:

Post a Comment