Click to See Complete Forum and Search --> : Fedora Core 3 insists on GNU java


hiwa
01-26-2005, 03:00 AM
Even after installing/setting the J2SE from Sun, Fedora Core 3
calls /usr/bin/javac and/or /usr/bin/java for javac and java commands.

Renaming or chomod -xing their files have no effect for the
stubbornness of calling /usr/bin/... versions.

Why?
And, how to disable it?

Thanks in advance.

ArtVandelay
01-26-2005, 05:38 AM
You may have to go to /etc/profile
and make sure the path to the sun java binaries
gets put into the $PATH environment variable
before /usr/bin.

You could try making it the first item in the path.

Alternatively, you might be able to just go
to your ~/.bashrc and do something like

PATH=/java_sdk_path/bin:$PATH

ArtVandelay
01-26-2005, 05:40 AM
That /java_sdk_path/bin
I put was just a generic example.

On my system, it is:
/opt/j2sdk1.4.2_04/bin

hiwa
01-26-2005, 07:31 AM
Thanks. But I set the PATH for J2SE bin and renamed + made -rw-r--r- the files in
the /usr/bin. Then again, FC3 tries to call /usr/bin/javac, which is already non-existant
executable nor symlink. Is the /usr/bin/javac written on the rock for FC3?

ArtVandelay
01-26-2005, 02:05 PM
But I set the PATH for J2SE bin and renamed

OK, but which one appears FIRST in the path?
Thats what really matters. Linux will execute whichever
one it finds first, according to the path.

echo $PATH
and take a look.

You could also possibly rename javac and java in /usr/bin
Although that wouldn't be the "industry recommended" way to do it. :)

ArtVandelay
01-26-2005, 02:14 PM
Here's an example below. I wrote a shell script called
javac, put the directory it was in as the first one
on the path, and sure enough, when I type javac, it
executes my shell script.


[gjduff@melvin temp]$ pwd
/home/gjduff/temp
[gjduff@melvin temp]$ cat javac
#!/bin/bash
echo "yep"
[gjduff@melvin temp]$ PATH=/home/gjduff/temp/:$PATH
[gjduff@melvin temp]$ echo $PATH
/home/gjduff/temp/:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/j2sdk1.4.2_04/bin:/opt/NetBeans3.6/bin:/home/gjduff/g/gkill:/home/gjduff/bin
[gjduff@melvin temp]$ javac
yep