[Techtalk] Java on Linux

Aaron Mulder ammulder at alumni.princeton.edu
Thu Jan 10 10:56:36 EST 2002

	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 well-regarded.  
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 instead
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 Blackdown-1.3.1-FCS)
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 original 
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 either 
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 :)

More information about the Techtalk mailing list