Using java in FC1(with eclipse)-help needed

Kaustubh Ghosh meetkaustubhghosh at vsnl.net
Wed Mar 17 06:23:32 UTC 2004


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