LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-09-2002, 10:36 PM   #1
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Rep: Reputation: 30
How to set Default Java VM/SDK in SuSE?


Hi All,
I'm running SuSE Linux Professional 8.0

I ran the command java -version to find which default VM the system used, and this is what it said:

Quote:
samer@linux:~> java -version
java version "1.1.8"
samer@linux:~>

Note: I have the J2SDK and J2RE installed in /usr/java. I verified the version like this:

[QUOTE]
samer@linux:/usr/java/j2re1.4.0_01/bin> java -version
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
samer@linux:/usr/java/j2re1.4.0_01/bin>
[/QUOTE[

My Question Is this. How do I set the DEFAULT Java VM to be the 1.4 as opposed to the old 1.1.8???

Can anyone help? Thanx,
 
Old 09-09-2002, 10:45 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
The geeko might be cooler, but Tux is warmer
How is original java got installed? Is it kaffe?
Find the appropriate RPM and remove it (can be kaffe).
Other solution is to place java 1.4 in your path before the directory where the original java is. For instance,
which java
might return
/usr/bin/java
Java 1.4 is under /usr/java/bin/java
so make you PATH to point to the newer java first
export PATH=/usr/java/bin:$PATH
to make it permanent add this line
PATH=/usr/java/bin:$PATH
in /etc/profile before
export PATH YADA BLAH
 
Old 09-10-2002, 01:23 AM   #3
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
hmmm, BIG problem. I checked the /etc/profle file and it had ONE instance of the word PATH. It looked like this EXACTLY
Quote:
export PATH
So I put the following line BEFORE this statement:
PATH=/usr/java/j2re/bin:$PATH so it looks like

Quote:

PATH=/usr/java/j2re/bin:$PATH
export PATH
And then I had to reboot (as my machine froze while doing something else). I come to booting up the mahcine again, and I'm in runlevel 3 (multi user console). Now since the ath got changed NONE of the commands work. And I mean NONE. Not even ls !!!
I tried ls, startx, and vi and they all don't work (bad command, etc...). The ONLY command that DOES work is cd.

HEEEELP!
 
Old 09-10-2002, 10:35 AM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Uh-oh, that is probably due to the power failover (hard recycling), Did you save the file before the system froze, was that file open during crash?
 
Old 09-10-2002, 03:52 PM   #5
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
I closed the file before the system froze. I was working on something entirely different in a console prompt (compiling a screen saver) when the system froze. In Any case, Im stuck with a pretty much useless Linux. Unless I can quote-unquote "fix" it I will be forced to re-install it
 
Old 09-11-2002, 12:27 PM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
u probably overwrote the PATH variable. that is a real bad thing to do in linux. i did that myself a couple days ago. when booting the system it does not have any programs to mount sth and there's nothing more to say .
Suse defines the PATH in /etc/rc.config. so if u want to make changes or add java to the path u should be f***ing careful if u don't know exactly what you're doing
for the future:

export PATH="/usr/java/j2sdk/bin":$PATH
export JAVA_HOME="/usr/java/j2sdk"

place that under the definition of the PATH.
if u chmod 0666 /etc/rc.config u might have access to it using the user bash.

if u set the PATH for java in your /home/user/.bashrc first before editing the etc/rc.config -> then
`source ~/.bashrc'
and your user bash is still working u can apply the same changes to etc/rcconf
keep going!
jens
 
Old 09-11-2002, 04:05 PM   #7
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
Thanx j-ray. I will give that a shot
 
Old 09-21-2002, 12:46 AM   #8
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
Ok I edited the rc.config file so it looks like this.

Quote:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH="/usr/java/j2re1.4.0_01/bin":$PATH
export JAVA_HOME="/usr/java/j2re1.4.0_01"
Then I ran SuSEconfig to get things all updated.

Now I tried to see if the java has been set up, but no dice.
Quote:
linux:/etc # java
bash: java: command not found
Now I have two concerns

1.) Why would the jave not work?
2.) I have the Java SDK and JRE installed. As you can see above I am pointing to the JRE.

Can Anyone offer some much appreciated insite here?

Last edited by shassouneh; 09-21-2002 at 01:13 AM.
 
Old 09-21-2002, 09:54 AM   #9
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
1. u have point it to j2sdk-version/bin not to j2re
then
2.
type
'java -version' logged in as user
it's normal that u don't get sth just typing
'java'
i guess it should be working -
cheers, jens

Last edited by j-ray; 09-21-2002 at 09:57 AM.
 
Old 09-23-2002, 05:16 PM   #10
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
Nope, I pointed it to the directory, ran SuSEconfig, and still the same thing. I still get this:
Quote:
samer@linux:~> java
bash: java: command not found
samer@linux:~> java -version
bash: java: command not found
samer@linux:~>
Someone please help!
 
Old 09-23-2002, 05:19 PM   #11
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Original Poster
Rep: Reputation: 30
I even tried this, and it STILL does the same thing (as above):

Quote:
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/j2sdk1.4.0_01/bin
export JAVA_HOME=/usr/java/j2sdk1.4.0_01
 
  


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
Why There is no Java 2 SDK ? JOKe Debian 5 03-08-2005 02:37 PM
Set Numlock Off By Default On A Suse 9.1 Laptop? FluffyPanda Linux - Laptop and Netbook 1 07-28-2004 03:49 AM
How to set the default group for a new user in SuSE. jschiwal Linux - Distributions 1 07-24-2004 11:25 PM
How do I set default browser on kde 3.2 and suse 9.1? bruno buys Linux - Software 4 05-29-2004 01:15 PM
java sdk lsansan Linux - Software 1 05-11-2003 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:02 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