Java and RedHat 9.0 or "Why Bill Gates Never Has To Worry"
Warning: :newbie:
<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> |
i cannnot believe RedHat 9 is incompatible with Sun Java.
Is Mandrake better? |
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?!? |
omg i found the actual java files installed on my system....
|
"No Java virtual machine Could be found from your PATH environment variable"
* sigh * |
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 |
Quote:
|
Quote:
Mike |
Quote:
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. |
Quote:
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 |
Quote:
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? |
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! |
Quote:
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 |
File is named: .bashrc
No Files Found * sigh * starting to cry |
Wait...i found the file....but the Redhat Search feature doesnt find .hidden files...
okay...going slow...being patient. |
All times are GMT -5. The time now is 02:57 AM. |