[Techtalk] Java on Linux

Edward Bradley BRADLEDW at uk.ibm.com
Thu Jan 10 18:34:10 EST 2002

The environment variable to export is LD_ASSUME_KERNEL=2.2.5, for the
kernel fooling, this is needed if you are running on a pre-2.4.10 kernel,
with an SMP box I believe. Another useful thing is to include the current
directory (.), in your CLASSPATH, this tells the JVM to look there for
whatever class you want it to load. A lot of first time Java
users/developers give up, just because of that one thing. One other thing,
is that with the IBM JVM, you need to run 'java -fullversion', reason being
that 'java -version' doesn't instanciate a JVM to get the info, whereas
fullversion does.


                    Aaron Mulder                                                                                          
                    <ammulder at alumni.prin       To:     <techtalk at linuxchix.org>                                          
                    ceton.edu>                  cc:                                                                       
                    Sent by:                    Subject:     [Techtalk] Java on Linux                                     
                    techtalk-admin at linuxc                                                                                 
                    10/01/2002 14:56                                                                                      

           Well, I can't speak for FreeBSD, but I do Java development on
Linux for work, so I can at least help get up and running there.
(According to Google, a FreeBSD JDK is available via "ports", and a native
JDK may be included in the forthcoming FreeBSD 4.5)

           First, there's a 3-tier Java process on Linux.  Sun has a JDK,
which they have adapted for Linux.  Then Blackdown (blackdown.org) tweaks
Sun's release to work a little better on Linux (and support more CPU types
than x86), and then Caldera tweaks Blackdown's release to work a little
better on their distro.
           As well, IBM has released a JDK for Linux, which is
I think it may be based on the Sun source code, but it has diverged
greatly, including using a non-HotSpot VM.
           If you're new to Java on Linux, I'd try Blackdown's JDK first.
In the Sun or Blackdown case, you're probably safest going with 1.3.1 for
now -- IBM just calls theirs "1.3", though they're up to "Service Release
10" now.

           Whichever you pick, you should download a .tar.gz package
of an RPM -- this ensures that everything will be installed under one
directory, and you can more conveniently pick that directory.
Personally, I use /usr/local/java as the root of all my Java
installations, but it matters little.  So go to your favorite directory
and tar -xzf and you should get "jdk1.3.1/" or "j2sdk1.3.1/" or
"IBMJava2-13/" or whatever.
           To see whether it works, go to the JDK directory and run
"bin/java -version".  You should get something like:

java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build
Java HotSpot(TM) Client VM (build Blackdown-1.3.1-FCS, mixed mode)

           If it craps out, let me know the error message.  With the
1.3.0 series, there was a problem using certain Linux kernels that could
be resolved by adding some env variable in the Java startup script to
claim you were running 2.2.5 -- we can look that up.
           If you get a bunch of font not found messages when you run a GUI

application, there's an updated "jre/lib/font.properties" that Sun links
to in their release notes for 1.3.1.  This has been a problem on Red Hat
7.x for me, but it's easy to fix.

           Anyway, if "java -version" runs successfully, then you can
add <jdk>/bin to the system path (in /etc/profile) or create a little
script to set the path and JAVA_HOME for your current shell.  I prefer the
latter on a development box, since it's easier to swap between JDKs, but
otherwise there's no reason not to set it for the whole system.

           Beyond the JDK, I use JBuilder 4/5 for development, as well as a
boatload of open-source projects, and I can help get those configured too.




On Thu, 10 Jan 2002, Amanda Babcock wrote:
> > I'd be interested in that, especially from a Linux perspective.
> > I've written some applets, and periodically think about updating
> > my Java knowledge to get more fluent in new stuff like J2EE/Swing,
> > but I keep hitting problems getting downloaded JDKs to work at all,
> > and all the Java folks I know are Windows users.
> Ooh, yeah!  I've tried to learn Java before only to find that I couldn't
> figure out the basic "install what where, invoke it how" questions and
> quit in frustration.
> Of course, there's the fact that I'm actually on FreeBSD, not Linux...
> which means a certain amount of translating in the "where" department :)

Techtalk mailing list
Techtalk at linuxchix.org

More information about the Techtalk mailing list