LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-17-2006, 08:27 PM   #1
d1l2w3
Member
 
Registered: May 2004
Location: Amboy WA USA
Distribution: Mandriva 2007
Posts: 366

Rep: Reputation: 30
Need help with java


Trying to install 'Merchant of Venice' on a Mandriva 2005 LE system.

I get the following error:
[don@localhost venice]$ /home/don/venice/venice
Error: JAVA_HOME environment variable is not set. This should be
set to the installation directory of java.

jre1.5.0 is installed in /usr/local/jre*.

I did;
[don@localhost venice]$ ln -s /usr/local/jre1.5.0_06/plugin/i386/ns7/libjavaplugin_oji.so

What am I doing wrong?

dlw
 
Old 01-17-2006, 09:24 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Try running this:

$ env PATH=$PATH:/usr/local/jre1.5.0_06/bin/
$ /home/don/venice/venice

If that works, post back and we can edit certain bash config files so that your java "bin" directory is in PATH w/o typing the above "env" command every time you want to run the program.
 
Old 01-17-2006, 09:56 PM   #3
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
I'm guessing you are using bash so you need to add the following to your .bash_profile or .profile ?

export JAVA_HOME=/usr/local/jre*

replace the star with the version of the jre
 
Old 01-18-2006, 02:33 PM   #4
d1l2w3
Member
 
Registered: May 2004
Location: Amboy WA USA
Distribution: Mandriva 2007
Posts: 366

Original Poster
Rep: Reputation: 30
$ env PATH=$PATH:/usr/local/jre1.5.0_06/bin/
$ /home/don/venice/venice

Did not work.
Nor did this;

export JAVA_HOME=/usr/local/jre1.5.0_06
export JAVA_HOME=/usr/local/jre1.5.0_06/bin

I even moved jre to /usr/java/jre*

Any ideas?

dlw
 
Old 01-18-2006, 03:07 PM   #5
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
Did you do these one after another and retry i.e.

export JAVA_HOME....
run command
export JAVA_HOME....
run command

or did you do this
export JAVA_HOME
export JAVA_HOME
run command

You will also need you source you .bash_profile if thats where you are putting these lines.
source ~/.bash_profile

Finally you are
mixing syntax here evn PATH=$PATH... will not set the var you will need to run

export PATH=$PATH:/path/to/java/bin

Don't bother adding these lines to your profile yet, just run them like this in order right on the command line

$ export PATH=$PATH:/usr/local/jre1.5.0_06/bin
$ export JAVA_HOME=/usr/local/jre1.5.0_06
$ java -version

if you get a result like this :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Server VM (build 1.5.0_02-b09, mixed mode)


You are on the right track and java is in your path .. next run the following

$ ls `echo $JAVA_HOME`

you will get a result like :
bin COPYRIGHT demo include jre lib LICENSE man README.html sample src.zip THIRDPARTYLICENSEREADME.txt

If this all works make sure mandriva does not have gcj installed as it may conflict with the version you installed from sun. Here is how to check.

$ rpm -qa '*gcj*'

If you get a result then you will next have to think about if you want to uninstall it which means you will break some rpm dependencies but thats for another post.

-Matt
 
Old 01-18-2006, 04:23 PM   #6
d1l2w3
Member
 
Registered: May 2004
Location: Amboy WA USA
Distribution: Mandriva 2007
Posts: 366

Original Poster
Rep: Reputation: 30
/home/don/.bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
export JAVA_HOME=/usr/java/jre1.5.0_06

export PATH
unset USERNAME



[don@localhost ~]$ export PATH=$PATH:/usr/java/jre1.5.0_06/bin
[don@localhost ~]$ export JAVA_HOME=/usr/java/jre1.5.0_06
[don@localhost ~]$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
[don@localhost ~]$ ls `echo $JAVA_HOME`
bin/ COPYRIGHT lib/ man/ README Welcome.html
CHANGES javaws/ LICENSE plugin/ THIRDPARTYLICENSEREADME.txt
[don@localhost ~]$ rpm -qa '*gcj*'
[don@localhost ~]$ su
[root@localhost don]# rpm -qa '*gcj*'
[root@localhost don]#
 
Old 01-25-2006, 06:45 AM   #7
J.K
Member
 
Registered: Dec 2003
Location: Australia
Distribution: mandrake 10.1 Official
Posts: 218

Rep: Reputation: 30
I mucked around with this program a while ago and from memory you don't install it you run it. Have a look at the readme instructions and it will tell you how to do this. It is via the command line. Look for macd or macg, something like that. If you can't figure it out post back and when I get home I'll have a look for you.
 
Old 01-26-2006, 03:21 PM   #8
bobbelfield
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Mandriva 2006
Posts: 154

Rep: Reputation: 30
Your result from $ echo $JAVA_HOME is not right.
So you have to get it set correctly
I have the Software Development Kit...sdk version but here´s what I get
$ echo $JAVA_HOME /usr/java/j2sdk1.4.1_03/bin/
yours should return .......... /jre/bin/ and until it does it will not find java
I suspect adding a slash after bin might fix it or reinstall the jre folder as all the needed files may not be there

JK Installing and running seem to me to be the same A binary is placed in the /bin/ file and run ,installation does the same. A program cant be run until its in the $PATH

Last edited by bobbelfield; 01-26-2006 at 03:38 PM.
 
Old 01-27-2006, 12:14 AM   #9
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
An alternative method for setting up java would be to copy the script below to /etc/profile.d, name it something like sun_jdk.sh and make it executable using "chmod +x". After that do "source /etc/profile" and java should be in your path (check by doing "echo $PATH") and that of other users on your system.
Code:
#!/bin/sh
export JAVA_HOME=/usr/local/jre1.5.0_06
export MANPATH="$MANPATH:/usr/local/jre1.5.0_06/man"
export PATH="$PATH:/usr/local/jre1.5.0_06/bin"
If the paths in the script are different from your java installation path, then adjust them accordingly.

Last edited by reddazz; 01-27-2006 at 07:56 AM.
 
Old 01-27-2006, 07:28 AM   #10
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
So is this still not working? From looking at the output you pasted it looks like eveyrthing is correct?
 
  


Reply



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
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
java.lang.InstantiationException: java.sql.Connection poeta_boy Programming 2 07-06-2005 08:26 PM
Web start java not working (java works fine) powadha Debian 5 06-05-2004 12:57 PM
2 Questions: java calling system commands? PERL vs Java? randomx Programming 28 11-28-2003 08:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration