Re: [SLUG] How to join the secret Java Society

From: Tim Jones (tim@timjones.com)
Date: Mon Aug 05 2002 - 23:26:12 EDT


On Monday 05 August 2002 21:00, Paul M Foster wrote:

> Umm, excuse some dumb questions. I've never coded in Java. I only know
> that it resembles C++ but does its own garbage collection. And that
> browsers can run Java apps if there's a Java runtime and the browser has
> Java enabled.

Java was intended to cross-platform the browsers, but since Microsoft
effectively put an end to that, Java's biggest unexpected strength HAS been
on the server side. Don't let the little coffee cup fool you, it is VERY
capable, as long as Bill Gates has nothing to do with it.

> Second question is: how is it that you can have a "non-GUI"
> java app? Like one that could run in a curses environment? Or when you
> say "non-GUI", you really mean "has to run in X, but doesn't need a
> mouse to work"?

There are entire Java webservers (Apache's Tomcat, Sun's JSP/J2EE, JBoss), and
Java's actually really great at connecting to databases (JDBC seems way more
complete than ODBC or Perl-DBD/DBI). Ever visited a site that had *.jsp
extensions? That is a Java Server Page, which is basically a template system
for Java servlets. Servlets are little Java classes that run on the server,
each with it's own thread, serving up HTML and parsing GET/POST arguments,
and doing anything else they like in between.

I've been doing nothing BUT Java/JSP under Linux and Solaris for the past 15
months. I much prefer it to the Perl/CGI world, which is how I did things
for a long time before I discovered JSP.

> So based on your post, is it true that you can run a Java app outside a
browser?

Yes, you can run Java applications on any platform, GUI or not. Check out
DBVisualiser from minq.se. That is a wonderful example of a Java based
program that is very useful in an enterprise (lets you access any database
that has a JDBC driver, which is pretty much all of them, these days), and IS
graphical, and runs fine on Solaris, Windows and Linux (maybe Mac, too, but I
don't have one to play with).

Java's GUI was kinda clunky at first, it was called AWT. With 1.1 they
started distributing an additional JAR file called Swing, that had much
better graphical UI elements. With 1.2, that renamed the package, and made
it part of Java proper.

It's true that Sun owns the Java you get from Sun, but IBM has a great Java
compiler called Jikes, and there are different implementations of the JVM
(the part that actually runs Java) that do not come from Sun, and as far as I
know, those are NOT owned by Sun. It's also my understanding that the Java
Language Specification and the Java Virtual Machine Specification are not
restricted, so other IMPLEMENTATIONs of the compiler and JVM are not
necessarily restricted. Sun controls only their implementations and their
specifications.

In fact, the free Java VM that comes with Debian (and others, I'm sure) is
called Kaffe, and it IS GPLd, but has only VERY recently (like June) actually
able to do Graphics (and even that is only AWT, probably not Swing, I'll have
to check). That means, for a long time, it was doing useful things without a
GUI at all!

One other observation: Java in the browser is essentially dead - Microsoft has
(unfortunately) refused to ship a compliant JVM in IE, and has polluted
almost of our user's machines with that broken JVM. Worse than that,
Microsoft has talked of getting rid of even the broken JVM in a future
Windows version (maybe XP?)

Sites, of course, code mostly for the broken one, and that's why getting Java
to work in Linux BROWSERS is such a chore (after all, we don't want to break
OUR JVM to match theirs, do we?). The JVM in Netscape 4.x stagnated at
version 1.1.x for such a god-awful long time, and so wasn't much better.

But developments on the server side of Java are under no such attack, because
Microsoft proves none of the server-side Java tools...

There are people who are using Java on the server side under Windows are not
affected, because they use SUN's Java software ported to Windows. For that
matter, Java applets work fine in MSIE as long as you use Sun's Java-Plugin
(which again, is Sun doing the coding right under Windows). But of course,
so few people know about the Windows plug-in for Java, it's doesn't get
installed everywhere, etc....

It uses X11, video and mice just fine, in fact, wheel mice are finally
supported under JDK 1.4 and later.

Also, check out GCJ - it is a GCC compiler for Java source AND Java bytecode.
(native-compiling bytecodes basically amounts to taking Java executables and
speeding them up to native executables) and it's free (GPL) too!

Just for the record, I have no idea what is in Java RPMs and DEBs, I don't use
them. I always download the tar.gz from Sun, unpack it into /usr/local, and
adjust my PATH and CLASSPATH.

Could this be the topic of a presentation? I'm surprised no one has beat me
to the punch on this one. I often see questions here I can answer, but
usually someone steps up with a great explanation before I even get home to
read it). I am planning to start coming to meetings again... the last one I
came to was when a long-haired guy (sorry, can't remember his name, but I
think he was from NKS) was doing a presentation on setting up iptables.

Tim

-- 
------------------------------------------------
Timothy Jones - tim@timjones.com / tjones@tsiconnections.com
Unix/Linux/Java Programmer/DBA/SystemAdmin & Brasswind Player



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:57:07 EDT