 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

14th April 2005, 09:57 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 31

|
|
|
running Sun's Java compiler on Fedora
Fedora comes with GNU Java compiler, and today I found out how it sucks big time. I wanted to override the compiler with Sun's JDK, but no luck. I created file /etc/profile.d/runjava.sh in which I set JAVA_HOME, update PATH and CLASSPATH. However, after logging in again when I type java -v I get the header from GNU compiler. When I type echo $JAVA_HOME I get home of Sun's Java Compiler. What's going on here? Shouldn't /etc/profile.d/runjava.sh override whatever was set before?
thanks,
webtekie
|

14th April 2005, 09:59 PM
|
 |
FedoraNEWS.org Admin
|
|
Join Date: Feb 2004
Location: California, US
Posts: 561

|
|
Hello,
I would suggest to run my Java Post-Install script.
http://fedoranews.org/tchung/java/
Thomas Chung
|

14th April 2005, 10:11 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 31

|
|
thanks, I did but got some messages:
Quote:
alternatives version 1.3.11.1 - Copyright (C) 2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.
usage: alternatives --install <link> <name> <path> <priority>
[--initscript <service>]
[--slave <link> <name> <path>]*
alternatives --remove <name> <path>
alternatives --auto <name>
alternatives --config <name>
alternatives --display <name>
alternatives --set <name> <path>
common options: --verbose --test --help --usage --version
--altdir <directory> --admindir <directory>
java - status is auto.
link currently points to /usr/share/java/libgcj-java-placeholder.sh
/usr/share/java/libgcj-java-placeholder.sh - priority 100
slave rmiregistry: /usr/bin/grmiregistry
slave rmiregistry.1.gz: /usr/share/man/man1/grmiregistry.1.gz
Current `best' version is /usr/share/java/libgcj-java-placeholder.sh.
ln: when making multiple links, last argument must be a directory
$ echo $JAVA_HOME --> /usr/java/jre /usr/java/jre1.5.0_01
$ which java --> /usr/bin/java
$ man --path java --> /usr/local/java/jdk1.4//man/man1/java.1
|
|

14th April 2005, 10:17 PM
|
 |
FedoraNEWS.org Admin
|
|
Join Date: Feb 2004
Location: California, US
Posts: 561

|
|
|
BTW, did you install jdk or jre?
Unless, you're developing software with javac, you only need jre.
I think my script was tested with jre-1_5_0_02-linux-i586.rpm
Make sure you have only one jre directory in /usr/java
and remove any other java script in /etc/profile.d
Thomas Chung
Last edited by tchung; 14th April 2005 at 10:20 PM.
|

14th April 2005, 10:22 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 31

|
|
|
I have jdk install in /usr/local/java/jdk1.4 and JAVA_HOME references this path. Not running Java 5 yet.
Also, interestingly enough the plain java.sh in /etc/profile.d worked fine on my machine at home, but at work it gives me problems.
|

14th April 2005, 10:23 PM
|
 |
FedoraNEWS.org Admin
|
|
Join Date: Feb 2004
Location: California, US
Posts: 561

|
|
|
If you installed jre-1_5_0_02-linux-i586.rpm
then, you should've gotten following mssage:
[root@tchung-fc3 java]# sh java-post-install.sh
java - status is auto.
link currently points to /usr/java/jre1.5.0_02/bin/java
/usr/share/java/libgcj-java-placeholder.sh - priority 100
slave rmiregistry: /usr/bin/grmiregistry
slave rmiregistry.1.gz: /usr/share/man/man1/grmiregistry.1.gz
/usr/java/jre1.5.0_02/bin/java - priority 300
slave rmiregistry: (null)
slave rmiregistry.1.gz: (null)
Current `best' version is /usr/java/jre1.5.0_02/bin/java.
$ echo $JAVA_HOME --> /usr/java/jre1.5.0_02
$ which java --> /usr/java/jre1.5.0_02/bin/java
$ man --path java --> /usr/java/jre1.5.0_02/man/man1/java.1
[root@tchung-fc3 java]#
|

14th April 2005, 10:31 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 31

|
|
|
But what do I do if I need to run 1.4?
|

14th April 2005, 10:35 PM
|
 |
FedoraNEWS.org Admin
|
|
Join Date: Feb 2004
Location: California, US
Posts: 561

|
|
Quote:
|
Originally Posted by webtekie
But what do I do if I need to run 1.4?
|
Well,
Update my script to fit for your jdk 1.4.
Once again, make sure you have only one copy of jre or jdk directory in /usr/java and remove any other java script in /etc/profile.d
Thomas Chung
|

14th April 2005, 10:47 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 31

|
|
|
thanks, I'll give it a shot.
|

14th April 2005, 11:06 PM
|
 |
FedoraNEWS.org Admin
|
|
Join Date: Feb 2004
Location: California, US
Posts: 561

|
|
I just posted an updated version for j2sdk-1_4_2_08-linux-i586.rpm
http://fedoranews.org/tchung/java/j2sdk/
Let me know how it goes.
Thomas Chung
|

16th April 2005, 06:21 PM
|
 |
Retired Community Manager
|
|
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423

|
|
|
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 10:33 (Friday, 24-05-2013)
|
|
 |
 |
 |
 |
|
|