What is the official method to install Java on Centos? I searched, but could find no mention of Java on the Web site. Ted Miller Centos 4.3 x86_64 Indiana
On 8/6/06, Ted Miller <tmiller at broadcast.net> wrote:> What is the official method to install Java on Centos? I searched, but > could find no mention of Java on the Web site.Currently the "Best" method (very relative term here) is to get the sun java rpm from java.sun.com and install it. (run the bin, agree to the license and all that) This puts java on your system in /usr/java/java-version which is kind of a screwed up place, and is not in any user's path by default. To resolve this and make things work, you then need to install the compat-sun-java rpm from jpackage.org for your particular version of java. This puts it into the alternatives framework which fixes the path issues, sets it as the default, and makes it work. Hppefully there will be a better method soon. -- During times of universal deceit, telling the truth becomes a revolutionary act. George Orwell
Ted Miller wrote:> What is the official method to install Java on Centos? I searched, but > could find no mention of Java on the Web site.Here are some notes that I have: ================================= http://java.sun.com/javase/downloads/index.jsp Select the option JRE 5.0 Update <n> Download the file: chmod the file: chmod u+x the_file_you_downloaded exexute the file /the_file_you_downloaded Add the new directory in your path (this is usually something like /usr/java/jre1.x.x/bin) Once installed make certain that it runs and that you have the correct version by typing the following at a command prompt: java -version It should display a message similar to the following: java version "1.5.0-rc" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63) ====================================== Oh, and save the rpm that came out of the ./the_file_you_downloaded You can install it on any number of systems without telling Sun ;-)
Ted Miller wrote:> What is the official method to install Java on Centos? I searched, but > could find no mention of Java on the Web site. >I don't know about "official," but what I normally do is install Sun's JDK, then the compatibility package from jpackage.org. The Sun stuff out of the box does not work with the "alternatives" system in CentOS, but the jpackage package fixes that up and sets up a more "sane" environment. The name is usually something like 'java-{version}-sun-compat-{version and release}, you will find it under the "non-free" section of the jpackage.org web site. This package provides symlinks and directories to make the vendor-provided JDK play nice. Don't be put off by the "non-free" part, it just means that the packages require "encumbered" components (like Sun's JDK) to be rebuilt or installed. Official has nothing to do with it, but I find that it is a bit "cleaner" than just the Sun-provided JDK. Hope that helps! -- Jay Leafey - Memphis, TN jay.leafey at mindless.com -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5177 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.centos.org/pipermail/centos/attachments/20060806/42aed773/attachment-0002.bin>
On Aug 6, 2006, at 8:13, Ted Miller wrote:> What is the official method to install Java on Centos? I searched, > but > could find no mention of Java on the Web site.Like others already mentioned, there is no "official" way, and like others, I like to install the Sun JRE. I then run the following "alternatives" commands to make it the default version (this assumes you are using version 1.5.0_07 of the JRE): # alternatives --install /usr/bin/java java /usr/java/jre1.5.0_07/ bin/java 10 \ --slave /usr/bin/rmiregistry rmiregistry /usr/java/jre1.5.0_07/ bin/rmiregistry \ --slave /usr/lib/jvm/jre jre /usr/java/jre1.5.0_07 # alternatives --set java /usr/java/jre1.5.0_07/bin/java I currently have a dozen or so developer systems deployed using CentOS 4.3 and the aforementioned Sun JRE 1.5.0_07. Alfred
Check it topi in the centos forum I was with a problem with fedora-ds and it was perfect. Regards Jose Grid Systems http://www.centos.org/modules/newbb/viewtopic.php?topic_id=2903 Reconfiguring CentOS 4's default Java configuration. This is done as root or equivalent and is for jre adjust for jdk where needed; First remove /var/lib/alternatives/java file by typing; rm /var/lib/alternatives/java When asked press the 'y' key, Now to create the new (corrected) alternatives file for java type the following commands as root (modify for jdk as needed); /usr/sbin/alternatives --install /usr/bin/java java /usr/lib/jvm/jre-1.4.2-gcj/bin/java 1 /usr/sbin/alternatives --install /usr/bin/java java /usr/java/j2re1.5.0_06/bin/java 2 /usr/sbin/alternatives --config java You should now see for example: There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java *+ 2 /usr/java/j2re1.5.0_06/bin/java Enter to keep the current selection[+], or type selection number: Type: <choose 1 or 2> In the example above java is already configured correctly [*+ 2] to use Sun's Java, no changes are needed, just press the Enter key here. If you have been following the instructions then you should have the same results (version numbers may be sightly different). Now type; /usr/sbin/alternatives --display java You should see for example; java - status is manual. link currently points to /usr/java/j2re1.5.0_06/bin/java /usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1 /usr/java/j2re1.5.0_06/bin/java - priority 2 Current `best' version is /usr/java/j2re1.5.0_06/bin/java. Next you might want to create (or edit) /etc/profile.d/java.sh file, example below; export JAVA_HOME="/usr/java/jre1.5.0_06/bin" export JAVA_PATH="$JAVA_HOME" export PATH="$PATH:$JAVA_HOME" When done creating or editing the file type; source /etc/profile.d/java.sh Now any user root or other wise should be able to use the command; which java and the results should read something like; /usr/java/jre1.5.0_06/bin/java Also any user root or other wize should be able to use the command; java -version and the results should read something like; java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing) That's it, all done. -----Mensaje original----- De: centos-bounces at centos.org [mailto:centos-bounces at centos.org] En nombre de Ted Miller Enviado el: Domingo, 06 de Agosto de 2006 08:14 a.m. Para: CentOS mailing list Asunto: [CentOS] Official Java What is the official method to install Java on Centos? I searched, but could find no mention of Java on the Web site. Ted Miller Centos 4.3 x86_64 Indiana _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
Alfred von Campe wrote:> On Aug 6, 2006, at 8:13, Ted Miller wrote: > >> What is the official method to install Java on Centos? I searched, but >> could find no mention of Java on the Web site. > > Like others already mentioned, there is no "official" way, and like > others, I like to install the Sun JRE. I then run the following > "alternatives" commands to make it the default version (this assumes > you are using version 1.5.0_07 of the JRE): > > # alternatives --install /usr/bin/java java > /usr/java/jre1.5.0_07/bin/java 10 \ > --slave /usr/bin/rmiregistry rmiregistry > /usr/java/jre1.5.0_07/bin/rmiregistry \ > --slave /usr/lib/jvm/jre jre /usr/java/jre1.5.0_07 > # alternatives --set java /usr/java/jre1.5.0_07/bin/javaWhere can I find some information on this 'alternatives' commands to understand what you did here. My system is quite messed up right now with jre between jpackage and Sun stuff. Freemind is working, but Java in Firebird is broken.> > I currently have a dozen or so developer systems deployed using CentOS > 4.3 and the aforementioned Sun JRE 1.5.0_07. > > Alfred > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >