-   LinuxAnswers Discussion (
-   -   DISCUSSION: HOWTO: Install Sun's Java VM in Fedora Core 2 (

kevcart3 10-19-2004 11:55 PM

DISCUSSION: HOWTO: Install Sun's Java VM in Fedora Core 2
This thread is to discuss the article titled: HOWTO: Install Sun's Java VM in Fedora Core 2

salparadise 10-20-2004 03:23 AM

seems like a long winded way of achieving things
i just went to dag.wiers site and downloaded the j2re rpm and the mozilla-j2re rpm and that was that

FunkyRes 11-29-2004 02:30 AM

do NOT remove the java javac and jar files in /usr/bin

That is poor advice - and the symlinks you create will be destroyed in an rpm update to the packages that own them.

Instead, set your JAVA_HOME environmental variable and set $JAVA_HOME/bin at the beginning of your path.

Let's say for you example you installed blackdown j2re in /opt/blackdown/j2re-1.4.2-01

You would create a file called in /etc/profile.d/ containing the following:


export JAVA_HOME=/opt/blackdown/j2re-1.4.2-01
if [ `echo $PATH |grep -c "$JAVA_HOME"` -eq 0 ]; then
        export PATH=$JAVA_HOME/bin:$PATH

and make it executable ( chmod +x /etc/profile.d/ )

Watch what this does -


[buildmaster@devel ~]$ which java
[buildmaster@devel ~]$ echo $PATH
[buildmaster@devel ~]$

I did not have to remove any binaries or make any symlinks, when I log in - /etc/profile.d/ gets executed, putting /opt/blackdown/j2re-1.4.2-01/bin at the front of my path resultint in binaries contained within being at the front of my path.

In the case of the sun rpm mentioned in the article, it puts the java install in /usr/java/j2re1.4.1_01/ so you would change the JAVA_HOME in the above script to point to there.

mjbrej 12-07-2004 11:51 PM

Good Summary, Kevin! And THANKS!
Good summary of the basics--nice of you to take the time to write this up for others! One additional point--many java programs will allow you to specify the JVM you want to use via the -vm switch after the program executable. To use this (for example, if you have multiple versions of the JVM on your machine), you would just specify "-vm <path to correct version of your JVM> after the executable command. Hope this helps some of your readers who need some advanced information.

kevcart3 12-19-2004 06:41 AM

Java VM
Thanks for the advice guys, i just wrote this early one moring after spending a whole night trying to get it to work on my FC2 machine. I thought it would be good to pass my knowledge on from what I found.

spooon 08-09-2005 05:35 AM

Fedora Core 4 release notes now recommends that you DO NOT use Sun's JDK packages (see description of bugs). You should build the package from the JPackage Project instead.

The full instructions for building it are here; and the following is a summary of the steps:
1. become root
2. install the "java-1.5.0-sun-" package, with something like this:

rpm -i
3. it extracts stuff into /usr/src/redhat
4. download the "jdk-1_5_0_05-linux-i586.bin" file from Sun website and put it in /usr/src/redhat/SOURCES
5. run

rpmbuild -ba /usr/src/redhat/SPECS/foo.spec
6. in the /usr/src/redhat/RPMS/i586 directory, it makes the following RPMs that you can install:

* java-1.5.0-sun- - JRE (required)
* java-1.5.0-sun-devel- - JDK
* java-1.5.0-sun-src- - sources
* java-1.5.0-sun-demo- - demonstration files
* java-1.5.0-sun-plugin- - browser plugin
* java-1.5.0-sun-fonts- - fonts
* java-1.5.0-sun-alsa- - ALSA support
* java-1.5.0-sun-jdbc- - JDBC/ODBC bridge driver

7. If you install browser plugin and want to make it work, do something like this:

cd /usr/lib/mozilla/plugins
ln -s /etc/alternatives/jre/plugin/i386/ns7/ .

kevcart3 08-09-2005 08:24 PM

Thank you Spooon, these are some good updated instructions for FC4, seeing as how I wrote this for FC2, this is probably pretty outdated.

ArenaJAG 08-18-2005 12:06 PM

Is there another way I should be following to install on a RedhatES4 system?

If I run the rpmbuild command I get an error:
Bad exit status from /var/tmp/rpm-tmp.72538 (%prep)

Nothing built.




Nevermind :newbie: screwup. Gotit.

chriselswede 10-28-2005 02:54 PM

Hi Spoon,

the instructions you give in seem to be exactly what I need, thank you! However the link
seems to be old. Do you know where I could find this rpm today?

Thanks again

spooon 10-28-2005 03:34 PM

By the way, there is an article on FedoraNews that describes this method of installation (although a slightly different way of doing it).

All times are GMT -5. The time now is 05:18 PM.