LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices


Reply
  Search this Thread
Old 10-19-2004, 10:55 PM   #1
kevcart3
LQ Newbie
 
Registered: Jun 2004
Location: USA
Distribution: Fedora Core 2
Posts: 15

Rep: Reputation: 0
Post 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
 
Old 10-20-2004, 02:23 AM   #2
salparadise
Senior Member
 
Registered: Nov 2002
Location: Birmingham UK
Distribution: Various
Posts: 1,736

Rep: Reputation: 146Reputation: 146
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
 
Old 11-29-2004, 01:30 AM   #3
FunkyRes
Member
 
Registered: Mar 2004
Distribution: CentOS
Posts: 174

Rep: Reputation: 30
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.
 
Old 12-07-2004, 10:51 PM   #4
mjbrej
LQ Newbie
 
Registered: Jun 2004
Location: Monterey, California
Distribution: Fedora Core 4
Posts: 10

Rep: Reputation: 0
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.
 
Old 12-19-2004, 05:41 AM   #5
kevcart3
LQ Newbie
 
Registered: Jun 2004
Location: USA
Distribution: Fedora Core 2
Posts: 15

Original Poster
Rep: Reputation: 0
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.
 
Old 08-09-2005, 04:35 AM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
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 .

Last edited by spooon; 10-28-2005 at 02:40 PM.
 
Old 08-09-2005, 07:24 PM   #7
kevcart3
LQ Newbie
 
Registered: Jun 2004
Location: USA
Distribution: Fedora Core 2
Posts: 15

Original Poster
Rep: Reputation: 0
Thank you Spooon, these are some good updated instructions for FC4, seeing as how I wrote this for FC2, this is probably pretty outdated.
 
Old 08-18-2005, 11:06 AM   #8
ArenaJAG
LQ Newbie
 
Registered: Aug 2004
Distribution: Fedora C3
Posts: 12

Rep: Reputation: 0
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 screwup. Gotit.

Last edited by ArenaJAG; 08-18-2005 at 03:00 PM.
 
Old 10-28-2005, 01:54 PM   #9
chriselswede
LQ Newbie
 
Registered: Oct 2005
Location: Canada
Distribution: Fedora Core 4
Posts: 1

Rep: Reputation: 0
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
 
Old 10-28-2005, 02:34 PM   #10
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
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).

Last edited by spooon; 10-28-2005 at 02:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Install KDE 3.4 in Fedora Core 3 without Applications Crashing hari_seldon99 LinuxAnswers Discussion 6 08-17-2005 05:38 PM
Install Java development environment on Fedora Core 2 WesleyVH Linux - Software 2 10-13-2004 09:50 AM
Sun's Java VM (HOWTO) kevcart3 Linux - Software 0 09-23-2004 05:40 AM
Java Install Trouble with Fedora Core 2 Thats_My_Camino Programming 0 09-15-2004 05:40 PM
apt and java install Fedora Core 2 tommytomato Linux - Newbie 14 06-04-2004 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 01:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration