LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 12-02-2004, 12:38 PM   #1
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Rep: Reputation: 30
Java SDK and Fedora Core 3


I have recently upgraded to Fedora Core 3. After the install (which went flawlessly by the way). I went poking and prodding around my fresh install looking for changes and surprise, surprise! The "javac" command is now in the /bin directory! Being an novice Java coder I immediately brought out my USB drive (another surprise! GNOME 2.8 auto-mounts the drive and gives me an icon on my desktop! Hazaaah!). After recoiling from the nifty treat GNOME 2.8 gave me, I continued by opening a terminal window. Another surprise! The /mnt directory is empty. My USB drive and all other file systems are now under /media. No problem a quick fix:
Code:
 rm -rf /mnt
Code:
 ln -s /media mnt
Finally after these brief surprises I get to my Java directory and type:
Code:
 javac SimpleGui1P.java
The above line is how I compiled my code using the J2SDK package I aquired from java.sun.com
and I was expecting that this "javac" under my /bin meant that the package came pre-installed for me. Unfortunately, it does not seem that way. This is the error I was presented with after the javac SimpleGui1P.java line above:
Code:
libgcj-javac-placeholder.sh

This script is a placeholder for the /usr/bin/javac
master link required by jpackage.org conventions.  libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.
SimpleGui1P.java:0: warning: source file for class `MyDrawPanel' is newer than its matching class file.  Source file `./MyDrawPanel.java' used instead
I am assuming that the "javac" that comes with Fedora Core 3 is different from the one that ships with the J2SDK package. I am just wondering what these differences might be? Also would it affect anything on my system if I removed the "javac" under my /bin directory and added my J2SDK path to my PATH variable in order to use the "javac" command that comes with J2SDK package?

Thanks in advance.
 
Old 12-02-2004, 07:37 PM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
did you install any gcc-java packages. I am not sure, but that could be the source of your java compiler.
 
Old 12-03-2004, 07:37 AM   #3
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Original Poster
Rep: Reputation: 30
Ah ha! The answer reveals itself! Thanks for mentioning the gcc-java package. When I did my install I took the defaults for gcc configuration. I started an install on a separate machine and sure enough, in the Developments Tools list was gcc-java pre-selected and ready to install! Thanks a bunch, I never would have thought to look that up!
 
Old 12-03-2004, 09:37 AM   #4
FunkyRes
Member
 
Registered: Mar 2004
Distribution: CentOS
Posts: 174

Rep: Reputation: 30
Quote:
Also would it affect anything on my system if I removed the "javac" under my /bin directory and added my J2SDK path to my PATH variable in order to use the "javac" command that comes with J2SDK package?
Better thing to do - use the PATH

create an executable file in /etc/profile.d/ called j2sdk.sh

It should contain something like:

Code:
#!/bin/sh
export JAVA_HOME=/opt/blackdown/j2sdk-1.4.2
if [ `echo $PATH |grep -c "$JAVA_HOME"` -eq 0 ]; then
        export PATH=$JAVA_HOME/bin:$PATH
fi
That will put your j2sdk tools before any Fedora installed tools, and you don't have to remove anything.
 
Old 01-12-2005, 10:14 AM   #5
Doug.Gentry
Member
 
Registered: Aug 2003
Location: Enumclaw, Washingtion. USA
Distribution: Suse 9.2, Fedora 3, wifes XP
Posts: 143

Rep: Reputation: 15
Re: Java SDK and Fedora Core 3

Quote:
Originally posted by caps_phisto
I have recently upgraded to Fedora Core 3. After the install (which went flawlessly by the way). I went poking and prodding around my fresh install looking for changes and surprise, surprise! The "javac" command is now in the /bin directory! Being an novice Java coder I immediately brought out my USB drive (another surprise! GNOME 2.8 auto-mounts the drive and gives me an icon on my desktop! Hazaaah!). After recoiling from the nifty treat GNOME 2.8 gave me, I continued by opening a terminal window. Another surprise! The /mnt directory is empty. My USB drive and all other file systems are now under /media. No problem a quick fix:
Code:
 rm -rf /mnt
Code:
 ln -s /media mnt
Finally after these brief surprises I get to my Java directory and type:
Code:
 javac SimpleGui1P.java
The above line is how I compiled my code using the J2SDK package I aquired from java.sun.com
and I was expecting that this "javac" under my /bin meant that the package came pre-installed for me. Unfortunately, it does not seem that way. This is the error I was presented with after the javac SimpleGui1P.java line above:
Code:
libgcj-javac-placeholder.sh

This script is a placeholder for the /usr/bin/javac
master link required by jpackage.org conventions.  libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.
SimpleGui1P.java:0: warning: source file for class `MyDrawPanel' is newer than its matching class file.  Source file `./MyDrawPanel.java' used instead
I am assuming that the "javac" that comes with Fedora Core 3 is different from the one that ships with the J2SDK package. I am just wondering what these differences might be? Also would it affect anything on my system if I removed the "javac" under my /bin directory and added my J2SDK path to my PATH variable in order to use the "javac" command that comes with J2SDK package?

Thanks in advance.
Man, I saw that when I tried to get my java running. If you could take the time to explaine to me what you did and how you did it to make java work for you would be great. Heck, I'll even offer my first born! Trust me, you get off easy. He's 21 now and fully house broken and even polite and pleasure to be around..... 6 years ago was not the case.. Anyway, I digress ..... I've been battling with my Fedora core 3 and java now for two weeks trying to get it working.
like I said, I actually saw that
"libgcj-javac-placeholder.sh

This script is a placeholder for the /usr/bin/javac
master link required by jpackage.org conventions. libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous" thing but I really didn't know what do with it.

If you could help I would be most greatful
 
Old 01-12-2005, 02:02 PM   #6
marconegao
LQ Newbie
 
Registered: Jan 2005
Location: Brazil
Distribution: Fedora Core 3
Posts: 1

Rep: Reputation: 0
If your trying to use SUN J2SDK instead of this one, what I suggest you to do is:

- Edit your .bash_profile (or other profile, depending on which shell you use) to include, in the beginning of PATH, the path to the bin dir of your JVM. By doing this, when you try to compile or run java stuff, the system will search first in this dir for javac and java.
e.g. PATH = /usr/local/java/bin:$PATH...

- Include (still in your profile) a variable JAVA_HOME that points to your java home dir
e.g. JAVA_HOME = /usr/local/java/
export JAVA_HOME

I believe that should be enough.

Last edited by marconegao; 01-12-2005 at 02:04 PM.
 
  


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
Java SDK help! nr5 Linux - Software 5 06-10-2005 08:33 AM
Java SDK in Fedora Core 3 (64 bit) uphu Linux - Software 7 12-08-2004 05:47 PM
Java SDK Peleus Linux - Newbie 2 04-06-2004 08:31 AM
Java SDK adflynn Programming 2 02-03-2004 07:15 PM
java sdk lsansan Linux - Software 1 05-11-2003 12:58 PM


All times are GMT -5. The time now is 05:56 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration