Hey there! any question in your mind? Ask It Now!.

Popular Categories

How to set java and java home path in linux ubuntu?

+4 votes
asked in Programming by duke Expert (5,813 points)
edited by Bhartesh
i have installed ubuntu and now i want to add java and set java home path in linux ubuntu, can you help me?

Thanks for your help!

3 Answers

+2 votes
answered by AsfK (740 points)
edited by Himanshu
you can open your terminal and past this command

sudo apt-get purge oracle-java7-installer*

and put your password, hit enter Done!

now your java and set java home path in linux ubuntu has been added.
commented by Himanshu Expert (5,940 points)
Thanks AsfK +1 from my side :)
0 votes
answered by amit_pammu Expert (5,030 points)

If you want this environment variable available to all users and on system start then you can add the following code

to /etc/profile.d/java.sh (create it if you want):

export JDK_HOME=/usr/lib/jvm/java-7-oracle
export JAVA_HOME=/usr/lib/jvm/java-7-oracle

Then in a terminal run:

sudo chmod +x /etc/profile.d/java.sh
source /etc/profile.d/java.sh
0 votes
answered by jatin Expert (3,823 points)

If you are having a fresh system I mean you have a new machine and you have Installed Ubuntu now if you want to Install Java so just run this command in terminal :

$ sudo apt-get install openjdk-7-jre

Related Questions

+3 votes
2 answers 223 views
0 votes
1 answer 482 views
+1 vote
3 answers 489 views
+9 votes
1 answer 201 views
+1 vote
2 answers 283 views
+3 votes
1 answer 912 views

Not a Member yet?

Ask to Folks Login

My Account
307 Folks are online
2 members and 305 guest online
Your feedback is highly appreciated