I'm rather surprised no-one has mentioned this yet...
To run a Java program, you need a native program that will instantiate a JVM and tell it to run method(s) in Java class(es). One might call that program a Java launcher. By far the most common one is the "java[.exe]" program that comes with a JRE or JDK.
The main() method is
only special when the Java program is run via "java[.exe]" launcher. Another launcher might have entirely different behaviour.
You can obtain, or write for yourself, another Java launcher. You do this via a part of the Java Native Interface (JNI) called the Java Invocation Interface (JII?). A user-written Java launcher would typically be a C or C++ program (other languages are probably possible), which calls native functions in the JII to instantiate a JVM, find some Java classes and execute Java methods.
As an example, I wrote a Java launcher that does some licensing checks before decrypting some Java code. The encrypted Java code won't run with "java[.exe]" command. For obvious reasons, can't tell you more!
See
JII documentation.
[ July 03, 2007: Message edited by: Peter Chase ]