LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 12-09-2004, 02:08 AM   #1
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Rep: Reputation: 30
Unhappy 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.
 
Old 12-09-2004, 03:32 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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/* ."
 
Old 12-09-2004, 07:35 AM   #3
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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]$
 
Old 12-09-2004, 08:04 AM   #4
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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!
 
Old 12-09-2004, 08:57 AM   #5
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
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,
 
Old 12-09-2004, 10:51 AM   #6
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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.

Last edited by Lakota; 12-09-2004 at 11:13 AM.
 
Old 12-09-2004, 02:49 PM   #7
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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.
 
Old 12-10-2004, 03:25 AM   #8
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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.
 
Old 12-10-2004, 10:34 AM   #9
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
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
 
Old 12-10-2004, 11:34 AM   #10
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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.
 
Old 12-10-2004, 12:29 PM   #11
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
Hmmm...

urpmi jre

And I got Java.
 
Old 12-11-2004, 01:09 AM   #12
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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.
 
Old 12-11-2004, 07:05 AM   #13
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
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.
 
Old 12-11-2004, 08:45 AM   #14
Lakota
Member
 
Registered: Oct 2003
Location: London, ON, Canada
Distribution: Mandriva 2007 Free
Posts: 507

Original Poster
Rep: Reputation: 30
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
 
Old 12-11-2004, 10:09 AM   #15
opjose
Senior Member
 
Registered: Sep 2004
Location: Outlying D.C.
Distribution: Mandriva
Posts: 2,090

Rep: Reputation: 46
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.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing java kshatriyarules Programming 2 12-02-2004 11:04 AM
Installing Java VM? broham Arch 1 11-12-2004 02:33 AM
Installing Java tarballed Linux - Software 7 08-27-2004 09:23 PM
Installing Java? loganwva Linux - General 4 02-17-2002 03:44 AM
Installing Java mrl Linux - Newbie 4 05-23-2001 02:19 PM


All times are GMT -5. The time now is 04:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration