Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I download jdk .bin file for linux . how to install it that all of the features enable in every where .

share|improve this question
2  
Which distribution do you use ? –  Gnoupi Aug 25 '09 at 11:26
    
Ubuntu 9.04 is distribution that i use –  SjB Aug 28 '09 at 10:29

3 Answers 3

up vote 2 down vote accepted

you must set Environment variable: do something like this:

export JAVA_HOME=/home/sjb/jdk1.6.0_16
export JRE_HOME=/home/sjb/jdk1.6.0_16
share|improve this answer

Personally I am not a big fan of JAVA_HOME and the like. It speaks of global, unscoped data, and that is a bad thing. I prefer to just have symbolic links in /usr/bin and leave it at that (still global data, but less of it because most likely you will still require the symbolic links anyway).

When installing from a .bin these are the steps I take: 1) Execute the .bin file. This creates a directory with the JDK inside 2) Move the directory to a shared system location. I use /usr/java. You may chose /usr/share/java, /opt and so on 3) Create symbolic links in /usr/bin for java. javac and the other executables

Some applications DEMAND a JAVA_HOME (e.g. Tomcat). If this is the case I do a:

export JAVA_HOME=/usr/java/java-1.5; ./runApp
share|improve this answer
    
this manual not work –  SjB Aug 28 '09 at 10:27
    
Which bit did not work? –  Dan Gravell Aug 28 '09 at 15:19
    
JRE_HOME also needed –  SjB Aug 28 '09 at 16:07

I unpack it in /usr/java, and then create a file in /etc/profile.d to set the expected environment variables for everyone that logs in.

$ chmod +x ~/jdk-6u16-linux-i586.bin
$ cd /usr/java
$ sudo ~/jdk-6u16-linux-i586.bin
$ sudo vi /etc/profile.d/java.sh
  export JAVA_HOME=/usr/java/jdk1.6.0_16
  export PATH=$JAVA_HOME/bin:$PATH
$ sudo chmod +x /etc/profile.d/java.sh
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.