N
N
nessero2015-03-17 07:49:03
Java
nessero, 2015-03-17 07:49:03

How to set JAVA_HOME in debian?

Installed the openjdk-7-jdk package in debian, now you need to install JAVA_HOME, the question is which directory to specify as JAVA_HOME ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
protven, 2015-03-17
@protven

Well, firstly, I strongly do not recommend you to use open-jdk from standard reps, download a normal HotSpot from Oracle, from here . It is better to take jdk as a tar.gz archive, unpack it somewhere, you can to your home directory, you can in /opt/, well, write JAVA_HOME=/opt/jdk1.7_... .
If you really want to eat cacti, then look in the /usr/lib/jvm/ directory.
For example, I have
/usr/lib/jvm/java-7-openjdk-amd64/ lying around - this should be assigned to the JAVA_HOME variable.
Don't forget to put this in .bash_profile or .bashrc

A
AVKor, 2015-03-17
@AVKor

I agree with what is written above about which version of Java to use. But the rest is better done this way:
1) Install the java-package.
2) Get the latest version of Java from the Oracle website.
3) Build a deb package using java-package.
4) Put it in the system.
5) Since there will be several Java variants in the system, you need to specify which one to use:
(also configured for javac, javadoc, javah, javap, javaws).
6) In .bashrc put:

export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
export PATH=$JAVA_HOME/bin:$PATH

R
ruslanys, 2015-03-26
@ruslanys

I usually put the path to JAVA_HOME in /etc/environment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question