Help installing java
Yes I know, there are hundreds of how to's on this subject. Problem is, I installed java just after I installed 10.1 and java plugin worked for Firefox. This morning I tried running a jar program and no java command found.
When I ran 10.0 I managed to have jar programs run, and the browser plugin work.
I've reinstalled twice tonight, and first time jar files ran, but browser plugin caused Firefox to vanish when trying to render java. Second time nothing works. Ive gone from jre-1_5_0 to j2sdk-1_4_2_03, back to jre-1_5_0. Someone that really is familiar with this please put me back on track. Here is what I am doing:
Linux self-extracting file
Download and copy jre-1_5_0-linux-i586.bin to /home/don/src
% su -
# mkdir /usr/java (if it doesn't exist)
# mv /home/don/src/jre-1_5_0-linux-i586.bin /usr/java
# cd /usr/java
# chmod +x jre-1_5_0-linux-i586.bin
Now test Java:
# /usr/java/jre1.5.0/bin/java -version
Set the PATH environment variable:
Browser Java pluggin
To enable the java plugin for Browser, open the directory file:///usr/java/jre1.5.0/plugin/i386/ns7-gcc29 and copy libjavaplugin_oji.so to the Browser/plugins directory. and restart Browser.
The problem here could be with running the export path command; are you running this in a terminal? If so, please note that this will only effect the shell you're running the command from, and its children; it will not save the setting globally.
One place to change the global setting would be in your ~/.bashrc file. Alternatively, make symbolic links to the executable files in /usr/local/bin:
I just reinstalled java as per the instructions I'm following in my first post. Added your suggestion of
su -c "cp -l /usr/java/jre1.5.0/bin/* ."
Just before copying java plugin to Firefox plugin directory.
Now, java plugin missing message on java webpages in Firefox, and when starting a jar program I see:
[don@x1-6-00-0a-e6-91-be-32 don]$ java -jar jitac-0.2.0.jar
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.
But it is there:
[don@x1-6-00-0a-e6-91-be-32 don]$ /usr/java/jre1.5.0/bin/java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
Thought I might mention this new annoyance. During all hours I've spent trying to set up java, done it over a dozen times with no problems, don't know what I'm doing wrong this time, I had something strange happen. I was superuser in Konsole and called Nautilus, copied java plugin from /usr/java/jre1.5.0/blah,blah, and after closing Nautilus, I did not get a prompt back in Konsole. Has happened to me in past, and hitting enter key usually makes it appear. That did not work so closed session in File dropdown menu. This threw me into root gui desktop! Logged out of root session and in as regular user. Since that every subsequent reboot lands me in my regular user desktop with a "Run as root-KDE su" login box. Command:
"106dfe2cb0000blah blah' '--screen' '0'
I don't give it password and hit cancel, but returns every reboot!
First: To get your GUI back, edit /etc/inittab as root user. There is a line something like:
The <runlevel> should be the number 5 if you want the GUI to load on start up. My guess is it is set to 3 now.
Second: If the java runtime is installed in your user directory ($HOME) and you installed the Firefox RPM, then Firefox is installed system wide, but java is installed with user permissions only. You will get better results by installing the java runtime as root so it gets installed system wide too. The installer will handle any configuration needed, and jave will be installed under /usr/java/j2re<version number>. This has worked for me through all versions of Mandrake since MDK 6.x
Sorry, maybe i wasn't clear on Gui. Never left runlevel 5. What happened was when I closed Konsole, my desktop turned red, and I was logged in as root. When I started that Konsole session I was not logged in as root, only regular user. During Konsole session I su'd to root privilage, could not get prompt back after closing su induced Nautilus session, closed Konsole session, and my desktop background changed to red. I checked and I was logged in as root in a runlevel 5 session. I did not login as root. It seems Konsole did it when I lost the command prompt. I only mentioned that as I was doing something I always did in Mandrake 10.0 and never experienced that before. And, it appears to be connected to the weird "Run as root-KDE su" login box ontop of my regular user (runlevel 5) desktop when I reboot.
Java is installed in /usr/java/jre1.5.0/bin/java, not home, and was installed as root. Not using Firefox rpm, using Firefox 1.0 manually installed into /home/don/firefox.
UPDATE: I fired up Nautilus again, and instead of getting a Nautilus window, I got about eight of them. Same ones I was using a dozen reboots ago when I lost command prompt, so closed them all and rebooted and I no longer get "Run as root-KDE su" login box ontop of my regular user (runlevel 5) desktop. So that is no longer an issue, back to sleep, then work, and hopefully tonight back to java install fiasco.
You need to tell the system where the libjava.so library file is. You could symlink /usr/java/jre1.5.0/lib/i386/libjava.so to /usr/local/lib as before, or add /usr/java/jre1.5.0/lib/i386/ to your /etc/ld.so.conf and then run
Holy Hell!! Somebody take my root privilage away, I'm a danger to myself!
Still had no luck getting either jar files or java plugin working. Found current java rpm on Mandrake mirror, installed that. Perfect, now my java browser plugin works, but jar files still don't. So I figure must need to set path now. Try following suggestions on that, done it before, don't know why but not working for me now. Google around and find this thread:
I followed what I found on post #23 of that thread. After rebooting I came to user login and it just persisted, could not start my user account.
As an after thought I've decided I will not delete and replace lines which I don't understand, I will in future comment them out and add new line. I could not remember how line read so had to boot Knoppix so I could google for sample .bash_profile to find one that had a line that looked familiar. The line I deleted and replaced with java path was:
Tried a hundred ways to get in to edit and save old line back. Even using Kate as root in Knoppix said I did not have permission to save my changes!? Finally found Mandrake failsafe got me to single user mode, but Kate (only editor I've ever used) would not work due to path to home not being set? Anyway, learned how to use vim a little bit and now have system restored.
So, I now have j2re-1.4.2_06-1mdk.i586.rpm installed and java plugin working in Firefox. Any help so I can run jar files would be appreciated. Also, if someone can explain why when I followed post #23 in the link, it crippled my system, when the guys in the thread said it fixed their java problems.
By replacing everything in your $PATH with /usr/java/j2re-1.4.1_02/bin you have removed all the usual places that one would expect to find binaries (/usr/bin/ /usr/local/bin etc). You need to use
To run a JAR file, you also need to specify the classpath to point to where your Java library files are:
As an alternative, you can specify the classpath on the command-line, and/or use absolute paths:[code]/usr/java/j2re-1.4.1_02/bin/java -classpath /usr/java/j2re-1.4.1_02/bin/java/etc. -jar file.jar
Thanks for all the help, I've followed your fixes and no go. I must have something screwy in my config of Mandrake, I've spent many hours at this, and it has never taken more than 15 minutes in past to get it all working. I figure it is about time to give up and do a fresh install, and see if I can set up java on fresh install on the weekend.
And I got Java.
Ok, tried that. First I uninstalled Sun Java. Tried urpmi jre, and it installed Kaffe from cd 4. Kaffe will run my jar files, perfect. Kaffe did not install a plugin nor am I familiar with Kaffe to find a plugin for Firefox with it. Left Kaffe installed, reinstalled j2re. So I suppose this is working fine, Kaffe for my system java and J2re for my browser plugin.
I suppose you can't use kaffe for browser plugin?
If not, this setup works, thanks 2all posters 4 all suggestions.
I always go to the repositories to install software.
Kaffeine works for me from within Konqueror just fine...
You may want to try following the directions in my sig and then running "INSTALL SOFTWARE" to pick up what you may be missing.
On my main systems I have plenty of disk space, so I usually install just about everything (yeah I know a waste of space but boy it sure makes things easy....).
I find that after doing so everything tends to work... except those packages which conflict with one another, which I really don't do force installs on.
Actually the first thing I do is set up all sources except jpackage after fresh install. I also always "update" the sources prior to installing any software (which is something else the newbs should be told, as I used to think when trying to install off say plf and my box said something was available but could not retrieve it I used to think the source was down. Since found it is just usually packages have changed since I downloaded the hdlist.cz for that source). I looked at jpackage rpm's and see they have sun java rpm, so in future will include it when setting up sources.
Not being a Mandrake club member, even though I came by a copy of install cd four, I don't have kaffe or jre listing in "install software" in graphical "mcc". This probably being when doing install it asks you to register your installation at the end. If you are not a club member you skip registration and don't have contents of fourth cd show up, so you don't know what is on it. ( Guess good idea to manually look through it, but really I and many others don't have a right to hold that cd, or have downloaded the three cd set).
Plan to rectify the mandrake club thing in January. I dropped windows completely, due to many issues. I jumped on the Linux band wagon probably due to the for free, and fact that I find applications such as gtkpod are way better than stuff like iTunes 4 windows or mac. This is due to the fact that software will always be more functional and be set up more how you would like to see it set up in linux due to the fact that it is enduser (programmer/hackers) writting the stuff rather than a corporation telling a group of employed programmers this is what we think the enduser will want, build it like this...
I have found Mandrake product to be functional and user friendly enough that my perception of "free" has changed. In future I would not financially support Mandrake if it stopped producing a "free" download version for the public, but I am going to start a club membership in January for the following reason. Mandrake does not force me to buy product. When I join club next month, it will not be to buy a product, but to "support" the "development" of a product that provides me with my main source of entertainment. I have decided to put some dollars into development due to the fact that Linux as a graphical desktop rather sucked in my opinion six years ago. But I love it now. If you look at the speed of development of usability in the last six years between Linux distros and development of usability Windows in the last six years, it seems clear to me that the dollars spent on M$ products are not funneled into the development department, whereas Linux distros which only get financial support from "some" of its user base went from a teeth grinding with fingers crossed installation six years ago for me to easier and faster to install (than windows), if you care to install at all. My other box is a p3 450 with knoppix 3.6 no hard drive and 256meg Intelligent stick to save settings. And for broken windows boxes how is the norm to get on the net to find fixes.......linux live cd's........I can't believe I just wrote so much, although it is vaguely relevant, java works, time to close the thread
ALMOST everything posted by Mandrake to club members becomes available to non-members sooner or later via the repositories.
My only complaint is that the driver RPM's really should be released even with Community CD's.
This would solve 90% of the installation issues newbies have and help to create a much better user experience for first time adopters.
This is the one area that I believe Mandrake is shooting themselves in the foot over.
|All times are GMT -5. The time now is 08:00 PM.|