Author: Last Man Standing
Email: mike@vu.com
Date Submitted: Thur, Apr 16, 1998
Edited By: Magnus Schoultz da96scma@ing.hj.se
Status: New Entry

Releases: 5.0 and 4.x
Platform: all
Category:  general
Category Listing:  How do I make Linux treat java-binaries as ordinary executables?

Issue


Linux beats them ALL! While all other OS's are TALKING about direct support of Java Binaries in the OS, Linux is doing it! You execute Java classes as you would any other executable, after a few small details:

Response

    - edit the file "/usr/src/linux/fs/binfmt_java.c" and change

    #define _PATH_JAVA    "/usr/bin/java"
    #define _PATH_APPLET    "/usr/bin/appletviewer"

     to wherever the java tools are on your system

        ie. /usr/local/java/bin/{java,appletviewer}

    - configure a kernel, and when asked about CONFIG EXPERIMENTAL
      drivers, answer "y".  continuing on, you'll be asked if you
      want to incorporate support for java binaries, so answer "y".

    - build/install the kernel, and reboot.

    - create the file /tmp/hello.java containing the following

    class HelloWorld {
        public static void main(String args[]) {
            System.out.println("Hello World!");
        }
    }

    - compile it using "javac /tmp/hello.java", which should create
      the file "/tmp/HelloWorld.class".  make this file executable
      and try to execute it.  you should get the following output:

    Hello World!

      indicating that your system can now run compiled java programs.

References

/usr/src/linux/Documentation/java.txt