Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am installing a new version of Java on a CentOS/RHEL Linux distro for a single developer to develop java.

The way I want to install on this development system is to just put the new java version somewhere and then update my path so that the new java is earlier on the path (and thus executes always) instead of the old version of java (which will be later on the path).

But while looking online I came across an official multi-page howto for this distro... and it describes a completely different idea of what I SHOULD do: http://wiki.centos.org/HowTos/JavaOnCentOS

For a single developer, is modifying the path (to point to the new java) going to work for developing java?

Why would you ever want to go through the laborious description seen on the above referenced official wiki page?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Installing Java is easy, just dump the jdk to /usr/local or /opt and then modify your PATH as you said. Personally, I would remove the old java path entirely, but that's me. I usually put it in /usr/local and then symlink it to a generic name, like simply jdk or similar, that way when I upgrade it I don't have to change anything that depends on the package. I only need to delete the symlink and recreate it to point to the new version.

I suspect you'll have other environment variables you'll need to modify in order for development to move forward. JAVA_LIB is a common environment variable, which would be set to the lib directory under the jdk, naturally.

Also, you said in your post "update my path", did you mean your personal PATH variable or did you mean the system wide settings ?? I only ask because if you modify your path the developer will not pick up the change in his PATH, if you're using separate logins.

As to the question of why anyone would follow that wiki page, I would hope no one would. It's 4 years old and hasn't been maintained since then according to the page.

All that being said, I'm sure that java is provided by your package manager (yum or what have you) and I would suggest that you go that route and let the system handle the installation for you if it can be done.

share|improve this answer
    
yum for centOS gets an older java... i want latest/greatest. hence manually getting latest java and doing what I am doing. –  Trevor Boyd Smith May 6 '11 at 21:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.