LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to set Default Java VM/SDK in SuSE? (https://www.linuxquestions.org/questions/linux-software-2/how-to-set-default-java-vm-sdk-in-suse-30015/)

shassouneh 09-09-2002 10:36 PM

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,

neo77777 09-09-2002 10:45 PM

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

shassouneh 09-10-2002 01:23 AM

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!

neo77777 09-10-2002 10:35 AM

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?

shassouneh 09-10-2002 03:52 PM

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

j-ray 09-11-2002 12:27 PM

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

shassouneh 09-11-2002 04:05 PM

Thanx j-ray. I will give that a shot :) :D

shassouneh 09-21-2002 12:46 AM

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?

j-ray 09-21-2002 09:54 AM

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

shassouneh 09-23-2002 05:16 PM

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!

shassouneh 09-23-2002 05:19 PM

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


All times are GMT -5. The time now is 07:45 AM.