Jump to content

installing j2sdk on redhat 9


Recommended Posts

I'm not sure if installing j2sdk has been covered somewhere on this board, but here's where I am:

 

I have downloaded the j2sdk rpm.bin file into my home dir.

 

Note: I have found several tutorials regarding installing java on linux, and I have printed one of them that appears to be what I need.

 

However, I'm a little unsure what dirs I'm supposed to be doing stuff in... :? My noobieness really shows on the linux fs. Also I've been apt-getting everything and its been doing it all for me... :lol:

 

Anyway, like I said, the rpm.bin file is in my home dir. am I supposed to move or copy it to /usr/src or whatever... :? Or do I do the ./ in my home dir ? And after I do the ./, where do I do the rpm -iv ?

I guess what I'm asking is that if I do all this in my home dir, will it get installed into the proper places ?

 

Also, the tutorial that I am using mentions that maybe I should create and edit java.sh in /etc/profile.d/ - but I don't wanna mess with that since I'm the only person in my household that even knows what java is...

 

btw: if I can do an apt-get install j2sdk I would rather do it that way. I googled apt-get +j2sdk +redhat but I didn't see what I was looking for...

 

As always, thanks for any tips...

Link to comment
Share on other sites

thanks ramfree, guess I should have look here first. :oops:

 

this doc is basically the same as the one I found by google. But my question is do I execute it (./) and install it "rpm -iv blah blah" within my Home dir (since thats where I downloaded it). I'm still a noob with rpm and any kind of installing (I'm getting spoiled on apt-get doing it all for me).

 

Will it all install to the correct places automatically, OR do I need to make the /usr/java/j2sdkversion folders first... :?

 

thanks !

Link to comment
Share on other sites

its been awhile since i installed java but my guess is yes. sun wraps the java rpm file in an executable that checks and decompresses (thereby producing) the actual rpm after you have agreed to the licensing agreement. you can then install the rpm normally using (this is how i do it)

 #rpm -Uvh <packagename>.rpm

.

 

it doesnt matter where you extract the rpm from the bin file but may i suggest that you do it in /tmp so it would not clutter your home directory afterwards?

 

this is the portion that i suggest the use of tmpwatch. there is an option in the mcc that enables cleanup of the tmp folder during boot but it doesnt always work for me so i use tmpwatch on a cron job. :)

 

ciao!

Link to comment
Share on other sites

you do just run the binary file and then install the rpm. You will need to then set JAVA_HOME to point to your installation and add $JAVA_HOME/bin to your path.

 

You can do this in ~/.bashrc using:

 

export JAVA_HOME=<wherever it's installed - probably /usr/java>

export PATH=$PATH:$JAVA_HOME/bin

Link to comment
Share on other sites

thanks, that clears up a lot.

 

when you say "extract the rpm from the bin file..." are you talking about the "./" ? Sorry, I've not really done this before. Do you mean move the rpm.bin file to a /tmp directory and then do the ./ ?

 

And then, since I do not have any previous Java version on my machine, I would do the rpm -iv from within the /tmp directory, and it would install to the necessary folders (and create them if it needs to)... :?

 

btw: I got j2sdk setup & working properly on my win2k machine, and I installed eclipse for windoze - everything works great. Obviously, I just need more linux experience with this stuff.

 

edit: I had this particular post on my screen for over an hour before I actually hit submit (I got sidetracked at work - had to do some work :lol: ). Anyway, I wrote this post BEFORE I saw phunni's post above. Thanks phunni !

Link to comment
Share on other sites

ok I did it all, except for the last step (the java_home stuff).

 

It appears to have installed properly. Now what I have to do is what phunni said ?

 

export JAVA_HOME=<wherever it's installed - probably /usr/java> 

export PATH=$PATH:$JAVA_HOME/bin

 

does the "wherever its installed" just need to be /usr/java, or does it need to be /usr/java/j2sdk1.4.1_05 (as the Doc shows) ?

 

thanks for all the help. Almost there. After its all done, how do I know java is working or not ? (I don't know java, but I'm taking a class soon). Do I just need to enter a "hello world" type program and see if it works ?

Link to comment
Share on other sites

ok, I tried to finishup the install.

 

java -version shows all the correct version info for java, JRE, and java hotspot

 

whereis java does not show anything

 

mozilla does not have java

 

I probably did not do the symbolic link right :? I typed the link as shown in the Doc on this board (while in my home dir logged in as root)

 

ln -s $JAVA_HOME/jre/plugin/i386/ns610/libjavaplugin_oji140.so /usr/lib/mozilla/plugins

 

EXCEPT: I wasn't sure about the oji140. The Doc was using j2sdk1.4.0 as an example, but the one I was doing was j2sdk1.4.1, so I typed oji141 instead of oji140. Does that matter ?

 

also since the sym link was very long it just wrapped to the next line automatically, or are you supposed to use some kind of continuation character ?

 

This seems more complicated than it needs to be, but probably mostly my fault... :?

Link to comment
Share on other sites

if you are using mozilla 1.4 or MozillaFireBird 0.6.1 then you will have to use the plugins which reside in

 

/usr/java/j2sdk1.4.2_01/jre/plugin/i386/ns610-gcc32/

 

and not

 

/usr/java/j2sdk1.4.2_01/jre/plugin/i386/ns610/

 

 

how are you going with the configuration ? I just finished configuration my java plugins for all my browsers along with SDK... let me know if you need any help

Link to comment
Share on other sites

I would just ls or cd the tree one at a time and see what java you have to be sure.

 

ls /usr

 

ls /usr/java/

 

ls /usr/jave/j2sdk1.4.2_01

 

blahblahblah to get to it, if nothing else is working, then do your symlink to the mozilla pluggins.

Link to comment
Share on other sites

It's because 4.2 was compiled against gcc3.2 (finally :roll: ) Using diff paths didn't help me. I had to get the older java-version, for a mozilla compiled with older gcc. Try both older and the new, and all paths....it's a pain, but.....

 

sometimes

file /usr/bin/name_of_app

will tell you what gcc it was compiled with. So, do;

file /usr/bin/mozilla

Link to comment
Share on other sites

$ ls /usr

bin etc include kerberos libexec sbin src X11R6

dict games java lib local share tmp

 

$ ls /usr/java

j2sdk1.4.1_05

 

$ ls /usr/java/j2sdk1.4.1_05/

bin demo jre LICENSE README src.zip

COPYRIGHT include lib man README.html

 

$ file /usr/bin/mozilla

/usr/bin/mozilla: Bourne shell script text executable

 

edit: Yes, I am using moz 1.4

Link to comment
Share on other sites

I will be taking a college course in java in a couple of months. Its an elective for my IT degree, so its probably fairly lightweight. It will be mostly doing applets. I do have java installed and working correctly on my win2k box, I've entered a few small programs (from examples in books) and they compile properly and run properly on my win box. I also installed Eclipse on my win2k box.

 

on my linux box, I'd like to pop in the "hello, world" program, compile it, and see if it runs. Simplest way to do that ?? I guess I can use vi to put it in.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...