LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-17-2003, 09:20 PM   #1
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Rep: Reputation: 0
Java and RedHat 9.0 or "Why Bill Gates Never Has To Worry"


Warning:

<soapbox>
Argh. This is the same problem I've had every time I think I'm going to use Linux.....I get so far and then whamo....all development stops because support documentation just does not exist.....

First off, I am trying to install Java on RedHat 9.0. I don't enjoy spending the weekend pouring over every conceivable support forum and documentation piece to install something as rudimentary as Java. ...but...welcome to the freedom of linux

I think I'm pretty patient and like to learn new things especially when it comes to technology but this is outrageous and exactly the reason I will continue to tell users to avoid Linux. (blah blah blah its not the software its the user but goddamn if any users with less computing experience could do this either)
</soapbox>

Off the soapbox and onto the problem....

<problem>
I first formatted my drive to "Start fresh". I updated all packages to have the freshest possible OS without corruption.

I then downloaded the latest version of java which is supposedly: j2re-1_4_2-linux-i586-rpm.bin found at
java.sun.com/j2se/downloads.htm

Off the bat I'm confused. all the resource material says "j2sdk-1_4_2_<version>-linux-i586.bin" so I cant really understand why Sun.com is giving me j2sdk instead of j2re in all the resource/installation instructions....

I followed the install instructions completely...
java.sun.com/j2se/1.4.2/install-linux.html

i thought i screwed something up but it did install because i get an ALREADY INSTALLED MESSAGE when I tried a reinstall......HOWEVER

when i type:
java -version

i get:
bash: java: command not found

I have not added anything to my PATH yet because (surprise) I cant even find WHERE the Path is.

a file search for "java" gives me this file found in usr/share/:

libgcj-<version>.jar

</problem>

Last edited by p.z; 08-17-2003 at 09:21 PM.
 
Old 08-17-2003, 09:36 PM   #2
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
i cannnot believe RedHat 9 is incompatible with Sun Java.

Is Mandrake better?
 
Old 08-17-2003, 09:38 PM   #3
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
developer.java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/

Red Hat Linux 9 and Java 2 Platform, Standard Edition 1.4.2: A Winning Combination
By Janice J. Heiss
August 2003

I DONT F*CKING GET IT WHY WRITE THIS ARTICLE IF THE OS DOESNT SUPPORT IT?!?
 
Old 08-17-2003, 09:44 PM   #4
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
omg i found the actual java files installed on my system....
 
Old 08-17-2003, 09:52 PM   #5
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
"No Java virtual machine Could be found from your PATH environment variable"

* sigh *
 
Old 08-17-2003, 09:54 PM   #6
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Dude... chill It usually installs in the /usr/java directory..., although it sounds like you've found it alread

Here's something that might help you in the future when you install an rpm and can't find where it put stuff.

Run "rpm -q --filesbypkg <package-name>". It will give you list of all files installed for the package.

Mike
 
Old 08-17-2003, 09:57 PM   #7
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by MiscGeek
Dude... chill It usually installs in the /usr/java directory..., although it sounds like you've found it alread

Here's something that might help you in the future when you install an rpm and can't find where it put stuff.

Run "rpm -q --filesbypkg <package-name>". It will give you list of all files installed for the package.

Mike
Thanks Mike, I found the files but the location is useless since I can't seem to add it to the path correctly. I tried adding it to the Path and Java is still not working
 
Old 08-17-2003, 09:58 PM   #8
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Quote:
Originally posted by p.z
"No Java virtual machine Could be found from your PATH environment variable"

* sigh *
Hmmm.. that's a new one on me Have you modified your $PATH in either the /etc/profile or ~/.bashrc and added path-to-java/bin/java to it?

Mike
 
Old 08-17-2003, 09:59 PM   #9
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by MiscGeek
Hmmm.. that's a new one on me Have you modified your $PATH in either the /etc/profile or ~/.bashrc and added path-to-java/bin/java to it?

Mike
This is the part I am unsure of. How do i add to the path? Do I manually edit the files in a text editor or through command line? None of the SUN resource material guides you through this part.

Which one do I add to? Both? Do I need to be root?

Argh! There are files in those directories you mentioned /etc/profile.d/ but How do i edit these...as root? With a text editor.


Last edited by p.z; 08-17-2003 at 10:04 PM.
 
Old 08-17-2003, 10:10 PM   #10
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Quote:
Originally posted by p.z
This is the part I am unsure of. How do i add to the path? Do I manually edit the files in a text editor or through command line? None of the SUN resource material guides you through this part.
You can change your path at the command line but for it to be permanent you will need to edit the text files. If you want the change to affect all users you would modify /etc/profile. If this is your development box and/or you are the only one that needs java you can just edit your /<user_name>/.bashrc file, replace <user_name> with your login name.

You can edit it with your favorite editor.

Here's the lines from my .bashrc. You will have to adjust them to match your setup. All of them are not really necessary but won't hurt

export JAVA_HOME="/usr/java/j2sdk1.4.2"
export JDK_HOME="$JAVA_HOME"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME/bin"

The same lines could be added to the /etc/profile file but you will need to be root to modify it

Note: You may need to logout and back in for the changes to take effect.

Mike

Last edited by MiscGeek; 08-17-2003 at 10:13 PM.
 
Old 08-17-2003, 10:13 PM   #11
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by MiscGeek
You can change your path at the command line but for it to be permanent you will need to edit the text files. If you want the change to affect all users you would modify /etc/profile. If this is your development box and/or you are the only one that needs java you can just edit your /<user_name>/.bashrc file, replace <user_name> with your login name.

You can edit it with your favorite editor.

Mike
When I search for "bashrc" i only get two files...

in /etc
in /usr/share/doc/bash<version>/startupfiles/

Im assuming it is one of these files but it is not in the location you said.

How do i search for .bashrc files? Can they be found by the redhat file search feature?

Last edited by p.z; 08-17-2003 at 10:15 PM.
 
Old 08-17-2003, 10:18 PM   #12
wdingus
Member
 
Registered: Aug 2001
Location: Kingsport, TN
Distribution: RHEL & FC
Posts: 267

Rep: Reputation: 30
Bear in mind that I admin a lot of RH9 servers but don't use Java myself and have never tried to install it. Thought I'd take a stab at it just for the heck of it though...

http://java.sun.com/j2se/1.4.2/download.html seems to be the place to be, small amount of surfing their site to find the download page. Downloaded the Linux JRE rpm "bin" file. Odd, it's not an RPM, it's a binary file you run that extracts an RPM file. Makes you agree to the license agreement so that's why they do that. No big deal...

# chmod a+rx j2re-1_4_2-linux-i586-rpm.bin
# ./j2re-1_4_2-linux-i586-rpm.bin
# rpm -ivh j2re-1_4_2-linux-i586.rpm
# java -version

At this point it still shows the installed RH9 Java stuff, whatever it is... So

# rpm -ql j2re-1.4.2-fcs

Shows me all the stuff from that Sun JRE RPM went into /usr/java/j2re1.4.2 In there is a bin directory with a java executable in it.

# /usr/java/j2re1.4.2/bin/java -version

That looks like it... OK, so this /usr/java/j2re1.4.2/bin directory is new and is NOT in my path... I'm logged in as root so:

# vi /root/.bash_profile

This line:
PATH=$PATH:$HOME/bin
I changed to:
PATH=$HOME/bin:/usr/java/j2re1.4.2/bin/:$PATH

Previously it took the contents of the environment variable $PATH and set it equal to itself and $HOME/bin appended to it. I changed it to make the PATH $HOME/bin, then the java bin directory, and then the rest of whatever itself was already set to. Logged out and back in and java -version now gives what I expect.

Potential problems with this way of modifying the path is that running things from cron or 'at' jobs or automated scripts might still use the default path and not find the Sun 1.4.2 Java files. Probably /etc/profile would need to be appropriately modified to set the correct PATH or make sure to give the full path in any scripts or cron jobs or whatever to the executable you want. Many other ways to skin this cat, that's just a couple.

Good luck!
 
Old 08-17-2003, 10:21 PM   #13
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Quote:
Originally posted by p.z
When I search for "bashrc" i only get two files...

in /etc
in /usr/share/doc/bash<version>/startupfiles/

Im assuming it is one of these files but it is not in the location you said.

How do i search for .bashrc files? Can they be found by the redhat file search feature?
Looks like you forgot the "." before the name There is one in the /etc directory but it's just the default.

Find files should find it make sure you include the "." i.e. ( .bashrc ), and that it is searching in "/home/<your_login_name/". Sorry, I think I may have left /home/ out in my previous post

Mike
 
Old 08-17-2003, 10:23 PM   #14
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
File is named: .bashrc

No Files Found

* sigh *

starting to cry
 
Old 08-17-2003, 10:26 PM   #15
p.z
LQ Newbie
 
Registered: Aug 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Wait...i found the file....but the Redhat Search feature doesnt find .hidden files...

okay...going slow...being patient.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bill Gates Will be interviewed by the spanish newspaper "El Mundo" aizkorri General 0 11-18-2004 03:46 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Europeans seem to have their act together, don't want Bill Gates "society" beginnerx Linux - Newbie 0 10-03-2003 06:25 AM
" Forget about Bill Gates, folks..." jamaso General 8 06-10-2003 04:16 AM
"Bill Gates' house is totally out of date." macewan General 17 05-11-2003 11:54 AM

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

All times are GMT -5. The time now is 02:42 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