Using java in FC1(with eclipse)-help needed
Matt Morgan
matt.morgan at brooklynmuseum.org
Wed Mar 17 16:20:54 UTC 2004
You need to be able to understand environment variables, such as
$JAVA_HOME, if you want to have any success with java. Or for this level
of help you should really follow the HOW-TOs that another poster pointed
you to. I recommend you spend some time with those HOW-TOs.
Anyway, here are my two steps of minimal step-by-step help. I think this
will get you the results you want, although there are probably better
ways to achieve what step 1 gets you:
1) Delete /usr/bin/java
2) add this line to /etc/profile:
$JAVA_HOME = /usr/java/j2sdk1.4.2_04/bin/
But as a former novice myself, I think it will benefit you to understand
why you are doing these steps. One day you're going to need to change
what's in step two, and it may not be a simple change (for example, if
you need to have two versions of java installed).
On 03/17/2004 01:23 AM, Kaustubh Ghosh wrote:
>On Wednesday 17 March 2004 02:35 am, Mark Eggers <mdeggers at earthlink.net>
>wrote:
>
>
>>>Kaustubh Ghosh wrote:
>>>
>>>I am quite novice towards java programming in linux.To start with I
>>>installed j2re1.4.2_03 and also j2sdk1.4.2_04 in FC1(Both from
>>>java.sin.com).Now peculiar problems arise.
>>>When I type "java -version" it gives 1.3.1(
>>>When I type "/usr/java/j2sdk1.4.2_04/bin/java -version" it gives
>>>1.4.2_04. Anyway I can compile any .java file with javac.
>>>But when I try to run it with java(any of the above) the gui would not
>>>come.(Hello World executes perfectly with System.out.println as also
>>>other non-gui programs).
>>>
>>>
>>You have both Sun's Java and GNU's Java installed. GNU's Java comes by
>>default when you select all of the compilers during the install.
>>
>>What I did was to find all the matching files in /usr that were supplied
>>by Sun's J2SDK and moved them to a /usr/<directory>/orig. I then added
>>my $JAVA_HOME/bin and $JAVA_HOME/jre/javaws to my PATH variable. javaws
>>is where Java WebStart is located.
>>
>>Like you, I have multiple Java versions installed. I usually keep the
>>current release and the previous release around in case something breaks
>>in the current release that didn't break in the previous release.
>>
>>To do this I make a symbolic link from where I installed Java to
>>/usr/java.
>>
>>For example, if I have j2sdk1.4.2_02 and j2sdk1.4.2_04 installed in
>>/usr, I will link /usr/j2sdk1.4.2_04 to /usr/java.
>>
>>I then set JAVA_HOME to /usr/java.
>>
>>This arrangement seems to work reasonably well. Another approach would
>>be to not make the link to /usr/java and just set the JAVA_HOME
>>environment variable appropriately.
>>
>>However, in both cases you'll need to take the GNU commands out of your
>>path and make sure that you have the Sun-supplied versions in your path.
>>
>>HTH
>>/mde/
>>
>>
>>
>
>
>Well,I think that is exactly my case.But being quite a novice I cannot do all
>you said(like setting JAVA_HOME).Can you just give me the commands to be used
>step by step.It would help me immensely.Thanks.
>
>
>
>
More information about the fedora-list
mailing list