arun reddy
arun reddy

Reputation: 31

How to set the path for jdk on linux 2.6.33-r2?

I have downloaded jdk7 from "http://www.oracle.com/technetwork/java/javase/downloads/index.html" and was trying to install it on linux platform (my OS is linux 2.6.33-gentoo-r2). I have done untar intially, then it created jdk1.7.0 folder. Can you please tell me how to set the path for jdk?

Upvotes: 1

Views: 2439

Answers (1)

AlexR
AlexR

Reputation: 115388

It is not a java question. Actually on linux you have to modify path in your login script. For example on my system where I use bash the file is .bash_profile and it is under my home directory.

So, edit this file. First define JAVA_HOME:

JAVA_HOME=/usr/java/jdk1.7.0

Then use JAVA_HOME variable in PATH definition:

PATH=$PATH:$JAVA_HOME

do not forget to export both:

export PATH
export JAVA_HOME

Upvotes: 1

Related Questions