The Austin Java User Group recently sponsored a contest to create the
smallest Java Hello World! program. The rules were simple: create the
smallest Java class that when executed will display the text "Hello World!"
(and only that text) to the console.
The restrictions were that the class must execute under Sun's 1.3 JRE. It may
make use of any class or file distributed with the JRE, but any additional
files (excluding arguments on the command line) count against the byte total
of the Java class file.
In this article, I explain how I arrived at my 70-byte solution. I hope that
in the process you learn a bit about Java class files and the Java Virtual
Machine. I also urge you to take the challenge before viewing my solution.
Getting Started
Let's first look at the canonical Java Hello World! program.
public class Hello
{
public static void
main(String[] args)
{
System.... (more)
Java is often criticized for its performance, particularly in comparison to
equivalent code written in languages such as C and C++. Advances in runtime
performance have silenced many critics, but still there are times when no
matter how fast Java is, it's just not fast enough.
Fortunately, Java does have some unique properties that make a class of
optimizations accessible that are not easily applied to other platforms. One
technique that can be used to great effect on certain types of tasks is
dynamic code generation.
Dynamic code generation is the process of generating Java clas... (more)
Releasing Java applications can be a real challenge. Fortunately, Java
provides a rich set of features for packaging and deploying applications that
can simplify the release process significantly.
This article presents some of the issues involved with packaging Java code.
I'll explore the Java manifest file and suggest ways it can be used to manage
JAR file dependencies and to eliminate classpath issues normally associated
with cross-platform deployment. I'll also explain how to use the
package-versioning features of the manifest to ensure the compatibility of
packages used.
Wh... (more)
Web sites were originally static. Later dynamic content came about through
CGI scripts paving the way for the first true Web applications. Since HTTP
was entirely stateless, it became necessary to invent ways for requests to be
linked together in a sequence. At first state was added to the URLs, but
later the cookie concept came into being. By giving each user a special
token, the server could maintain a context for each user, the HTTP session
where the application can store state. As simple as it is, the HTTP session
defines the entire concept of what a Web application is today.... (more)
Sun gave a demo of their new Java Desktop System at last week's AustinJUG
meeting. Of course, the "Java" Desktop has absolutely nothing to do with
Java. I see it as an admission by Sun that the Sun brand is dead. Nobody
wants to buy Sun hardware or software anymore. But, the Java brand still has
some value. My biggest fear in all of this is that instead of letting Java
pull Sun up, Sun has insured that the Java brand is going down with the Sun
ship. Let's all hope that Sun's fortunes turn.
An interesting point is that the Java Desktop System runs only on x86
hardware and not on ... (more)