LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxAnswers Discussion (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/)
-   -   DISCUSSION: HOWTO: Install Sun's Java VM in Fedora Core 2 (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/discussion-howto-install-suns-java-vm-in-fedora-core-2-a-244914/)

kevcart3 10-19-2004 10: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 02:23 AM

er
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 01: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 j2re.sh in /etc/profile.d/ containing the following:

Code:

#!/bin/sh
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
fi

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

Watch what this does -

Code:

[buildmaster@devel ~]$ which java
/opt/blackdown/j2re-1.4.2-01/bin/java
[buildmaster@devel ~]$ echo $PATH
/usr/kerberos/bin:/opt/blackdown/j2re-1.4.2-01/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/buildmaster/bin
[buildmaster@devel ~]$

I did not have to remove any binaries or make any symlinks, when I log in - /etc/profile.d/j2re.sh 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 10: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 05: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 04: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-1.5.0.05-1jpp.nosrc.rpm" package, with something like this:
Code:

rpm -i http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.05-1jpp.nosrc.rpm
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
Code:

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-1.5.0.05-1jpp.i586.rpm - JRE (required)
* java-1.5.0-sun-devel-1.5.0.05-1jpp.i586.rpm - JDK
* java-1.5.0-sun-src-1.5.0.05-1jpp.i586.rpm - sources
* java-1.5.0-sun-demo-1.5.0.05-1jpp.i586.rpm - demonstration files
* java-1.5.0-sun-plugin-1.5.0.05-1jpp.i586.rpm - browser plugin
* java-1.5.0-sun-fonts-1.5.0.05-1jpp.i586.rpm - fonts
* java-1.5.0-sun-alsa-1.5.0.05-1jpp.i586.rpm - ALSA support
* java-1.5.0-sun-jdbc-1.5.0.05-1jpp.i586.rpm - JDBC/ODBC bridge driver

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

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


kevcart3 08-09-2005 07: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 11:06 AM

Spoon
 
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.

Thanks,

JAG

EDIT:

Nevermind :newbie: screwup. Gotit.

chriselswede 10-28-2005 01:54 PM

Hi Spoon,

the instructions you give in LinuxQuestions.org seem to be exactly what I need, thank you! However the link http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.04-1jpp.nosrc.rpm
seems to be old. Do you know where I could find this rpm today?

Thanks again
/Chris

spooon 10-28-2005 02:34 PM

http://mirrors.dotsrc.org/jpackage/1...1jpp.nosrc.rpm

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 06:04 PM.