LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Help installing java (https://www.linuxquestions.org/questions/mandriva-30/help-installing-java-264339/)

Lakota 12-09-2004 02:08 AM

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
# ./jre-1_5_0-linux-i586.bin

Now test Java:

# /usr/java/jre1.5.0/bin/java -version

Set the PATH environment variable:

PATH="$PATH:/usr/java/jre1.5.0/bin:."
export PATH

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.

rjlee 12-09-2004 03:32 AM

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:
Code:

cd /usr/local/bin
su -c "cp -l /usr/java/jre1.5.0/bin/* ."


Lakota 12-09-2004 07:35 AM

I just reinstalled java as per the instructions I'm following in my first post. Added your suggestion of
cd /usr/local/bin
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)
[don@x1-6-00-0a-e6-91-be-32 don]$

Lakota 12-09-2004 08:04 AM

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:
nautilus '--sm-config-prefix'
'/nautilus-LMulzq/' '--sm-client-id"
"106dfe2cb0000blah blah' '--screen' '0'
'--no-default-window'

I don't give it password and hit cancel, but returns every reboot!

ernie 12-09-2004 08:57 AM

First: To get your GUI back, edit /etc/inittab as root user. There is a line something like:

id:<runlevel>:initdefault:

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

HTH,

Lakota 12-09-2004 10:51 AM

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.

rjlee 12-09-2004 02:49 PM

Quote:

Originally posted by Lakota
[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)
[don@x1-6-00-0a-e6-91-be-32 don]$

What has happened here is that it's found the binary files in /usr/local/bin, but hasn't found the runtime library (libjava.so) in /usr/java/jre1.5.0/lib/i386/

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
Code:

/sbin/ldconfig
to refresh your linker cache.

Lakota 12-10-2004 03:25 AM

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:
http://www.linuxquestions.org/questi...5&pagenumber=2
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:
PATH=$PATH:4HOME/bin:.
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.

rjlee 12-10-2004 10:34 AM

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
Code:

PATH=$PATH:/usr/java/j2re-1.4.1_02/bin
The $PATH: tells it to keep the existing contents.

To run a JAR file, you also need to specify the classpath to point to where your Java library files are:
Code:

CLASSPATH=$CLASSPATH:/usr/java/j2re-1.4.1_02/etc.
After logging in again you should be able to use
Code:

java -jar file.jar
You can also use
Code:

echo $PATH; echo $CLASSPATH
to see what your PATH and CLASSPATH variables 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

Lakota 12-10-2004 11:34 AM

rjlee,
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.

opjose 12-10-2004 12:29 PM

Hmmm...

urpmi jre

And I got Java.

Lakota 12-11-2004 01:09 AM

Opjose,
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?
http://www.linuxquestions.org/questi...hreadid=206569

If not, this setup works, thanks 2all posters 4 all suggestions.

opjose 12-11-2004 07:05 AM

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.

Lakota 12-11-2004 08:45 AM

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

opjose 12-11-2004 10:09 AM

Heh.

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.

Lakota 12-11-2004 12:30 PM

I will agree with you there. Got a call from a friend this morning, lost his gui on Mandrake due to upgrading video card from radeon 7000 to 9600and can't figure out how to get driver installed. I would have thought it would have run on generic ati driver at boot, install ati driver by hand later, but I'll figure that out tomorrow. Anyway, point of that is he is the only person I've managed to convert to Linux. He also has a windows xp partition and it was easy for him to install video drivers on that himself. That is why I'm going to start a club membership, and hope more Mandrake junkies start to think the same way. At the speed Linux desktop has evolved over the past few years, I believe if the big distros have some dollars to stay afloat and direct towards development, I feel sure Linux will surpass M$ in all areas within a short time. Ease of configuration & hardware support is really the only hurdle left in my opinion. And I admit I see huge strides with every Mandrake release. Unfortunately, in the mean time a couple other local guys I know of that recently tried out Mandrake, went back to m$ due to wanting to point and click in wizards only, no reading manuals. Hopefully the Linux Standard Base (LSB) 2.0 related stuff will help that all come together soon. I've read that Mandrake is involved with it.

ddrfreak 12-11-2004 02:12 PM

i used urpmi but it didnt work

opjose 12-11-2004 02:24 PM

ddfreak:

Start a new thread.

If it didn't work... then the reason is...

a) Your internet connection is not working
b) Your resolver is not working
c) You did not set up urpmi correctly
d) You did try to set it up correctly but the remote site you specified is unavailable, choose another
e) You did set it up correctly and the remote site WAS available, but it no longer is, or is too busy
f) You are lacking a package required by urpmi...
g) You were NOT logged in as root when you tried any and all of the above.

urpmi urpmi

to find out the latter.

Lakota 12-12-2004 02:02 AM

I will abandon this thread after this post. Seems I found my problem. Tonight I tried to use limewire rpm install and it did not work. Assumed kaffe was the problem, in the end it was not. To try to remedy, I uninstalled kaffe rpm, and the j2re-1.4.1_02 rpm. Using midnight commander i scanned through my whole root directory and found dozens of hidden (.java*) files. And four java folders from manual installs in directories other than /user/java. Deleted everything that had the word java from my hard drive. Added a MandrakeClub source to my sources, forget where I found the reference to it, anyway I had a j2re1.5.0 rpm appear. Installed that and absolutely everything works. Except for the LimeWire rpm in Jpackages not sure why. Grabbed Limewire.bin and installed manually and it works now. Jar files work, browser plugin, everything. Sweet. It appears this three day headache was caused by not getting manual installs completely removed I now assume.


All times are GMT -5. The time now is 09:31 AM.