Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14th April 2005, 09:57 PM
webtekie Offline
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
Reply With Quote
  #2  
Old 14th April 2005, 09:59 PM
tchung's Avatar
tchung Offline
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
__________________
Thomas Chung
http://fedoraproject.org/wiki/ThomasChung
Reply With Quote
  #3  
Old 14th April 2005, 10:11 PM
webtekie Offline
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
Reply With Quote
  #4  
Old 14th April 2005, 10:17 PM
tchung's Avatar
tchung Offline
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
__________________
Thomas Chung
http://fedoraproject.org/wiki/ThomasChung

Last edited by tchung; 14th April 2005 at 10:20 PM.
Reply With Quote
  #5  
Old 14th April 2005, 10:22 PM
webtekie Offline
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.
Reply With Quote
  #6  
Old 14th April 2005, 10:23 PM
tchung's Avatar
tchung Offline
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]#
__________________
Thomas Chung
http://fedoraproject.org/wiki/ThomasChung
Reply With Quote
  #7  
Old 14th April 2005, 10:31 PM
webtekie Offline
Registered User
 
Join Date: Feb 2005
Posts: 31
But what do I do if I need to run 1.4?
Reply With Quote
  #8  
Old 14th April 2005, 10:35 PM
tchung's Avatar
tchung Offline
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
__________________
Thomas Chung
http://fedoraproject.org/wiki/ThomasChung
Reply With Quote
  #9  
Old 14th April 2005, 10:47 PM
webtekie Offline
Registered User
 
Join Date: Feb 2005
Posts: 31
thanks, I'll give it a shot.
Reply With Quote
  #10  
Old 14th April 2005, 11:06 PM
tchung's Avatar
tchung Offline
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
__________________
Thomas Chung
http://fedoraproject.org/wiki/ThomasChung
Reply With Quote
  #11  
Old 16th April 2005, 06:21 PM
crackers's Avatar
crackers Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423
http://fedoraforum.org/forum/showpos...6&postcount=10 - sorry, Thomas - beat ya to it.
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:
Reply With Quote
Reply

Tags
compiler, fedora, java, running, sun

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
use Sun's Java, not GNU? wutbox Using Fedora 2 10th August 2007 08:46 PM
FC5 and Sun's Java mastahnke Using Fedora 7 30th March 2006 05:37 AM
Fedora Core 3 Java Compiler? darkcast66 Programming & Packaging 2 2nd August 2005 06:44 PM
Sun's java SDK on FC2 x86_64 mhec Using Fedora 11 1st September 2004 06:33 AM


Current GMT-time: 10:33 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat