[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Executing java applications



Ok, the story goes like this: You compile your applet with guavac/javac and 
run it with kaffe/java. Here's an example which uses guavac as a compiler and 
java as an interpreter. Kaffe didn't work for me for some reason but the 
procedure should be pretty much the same. All these are already packaged for 
Debian. Check non-free and devel sections.

#cat Hello.java
class Hello {
        public static void main (String[] args) {
                System.out.println ("Hello, world!");
        }
}
#guavac Hello.java
Compilation Successful: 1 classes or interfaces found:
 *  Hello
#java Hello
Hello, world!
#

Note that you don't need .class suffix when you run your java program.

There is support in the kernel for running the java classfiles from the 
command line but it's not on by default. It just runs java interepter for you 
and saves you typing a couple of characters.

The 'javac' and 'java' are part of Sun's JDK.

// Heikki



Reply to: