Setting JAVA_HOME

How do I set JAVA_HOME=/usr/lib/jvm ...E ? The instructions say to use

INSTALL4J JAVA_HOME=/usr/lib/jvm/java-6-sun

but I get an error that says:

INSTALL4J: command not found

I have downloaded INSTALL4J and I installed it (I think). It asked all sorts of questions that I did not know how to answer, so I just hit "Next" a lot. Any ideas?

2

1 Answer

Not sure where you get the instructions, but there's another way to set the JAVA_HOME as follows:

For single user:

vi ~/.bash_profile

you can change the vi to your favorite text editor like gedit

then at the end of the file put this:

export JAVA_HOME=<path-to-java>

where <path-to-java> in your case might be /usr/lib/jvm/java-6-sun/bin/java

now set PATH as follows (below JAVA_HOME):

export PATH=$PATH:/usr/lib/jvm/java-6-sun/bin

now save the file and exit, log out and login to see the new changes.

Note: if you want to set JAVA_HOME for all users this link might help you:source

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like