Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Java environment path in Ubuntu

I just installed JDK in Ubuntu with sudo apt-get install openjdk-6-jdk command, after the installation where's the Java bin directory located? And how can I set the environment path for that directory? I have little experience with Ubuntu, can anyone give some advice or suggest any good website for reference?

like image 471
Ullas Prabhakar Avatar asked Mar 08 '12 04:03

Ullas Prabhakar


People also ask

Where is JAVA_HOME set in Ubuntu?

You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment .


1 Answers

set environment variables as follows

Edit the system Path file /etc/profile

sudo gedit /etc/profile 

Add following lines in end

JAVA_HOME=/usr/lib/jvm/jdk1.7.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export JRE_HOME export PATH 

Then Log out and Log in ubuntu for setting up the paths...

like image 136
Pratap Singh Avatar answered Oct 05 '22 19:10

Pratap Singh