binfmt_misc for executable jar files

binfmt_misc for executable jar files

Post by Kurt Huwi » Wed, 27 Jun 2001 22:20:10



Hello!

The applied patch updates the documentation of using binfmt_misc to
execute Java applications. It adds support for executable jar files, the
normal packaging for Java applications.

With Windows, you just double-click on the file, so Linux should be able
to run them, too :-)

Kurt

P.S.: I am not subscribed.
--
------------------------------------------------------------------------
All these worlds are yours -- except Europa. Attempt no landings there.

[ executable-jar-file.patch 1K ]
--- /usr/src/linux/Documentation/java.txt       Thu Jul  1 19:47:08 1999

-               Java(tm) Binary Kernel Support for Linux v1.02
+               Java(tm) Binary Kernel Support for Linux v1.03
                ----------------------------------------------


    (you should really have read binfmt_misc.txt now):
    support for Java applications:
      ':Java:M::\xca\xfe\xba\xbe::/usr/local/bin/javawrapper:'
+   support for executable Jar files:
+     ':ExecutableJAR:E::jar::/usr/local/bin/jarwrapper:'
    support for Java Applets:
      ':Applet:E::html::/usr/bin/appletviewer:'

 ====================== Cut here ===================

-Now simply chmod +x the .class and/or .html files you want to execute.
+====================== Cut here ===================
+#!/bin/bash
+# /usr/local/java/bin/jarwrapper - the wrapper for binfmt_misc/jar
+
+java -jar $1
+====================== Cut here ===================
+
+
+Now simply chmod +x the .class, .jar and/or .html files you want to execute.
 To add a Java program to your path best put a symbolic link to the main
 .class file into /usr/bin (or another place you like) omitting the .class

        ./HelloWorld.class

+To execute Java Jar files, simple chmod the *.jar files to include
+the execution bit, then just do
+       ./Application.jar
+
+
 To execute Java Applets, simple chmod the *.html files to include
 the execution bit, then just do


 heavily edited for binfmt_misc by Richard Gnther



 
 
 

1. can not set binfmt_misc register, can not write to /proc/sys/fs/binfmt_misc/ directory

I have binfmt_misc compiled into my kernel and the
/proc/sys/fs/binfmt_misc/register directory exists but I can't set the
register key.


bash: /proc/sys/fs/binfmt_misc/register: No such file or directory

I get the following if I attempt to use sysctl:

wrapper:
error: 'fs.binfmt_misc.register' is an unknown key

And it does not get created.


total 0
dr-xr-xr-x    2 root     root            0 Feb 15 10:11 ./
dr-xr-xr-x    3 root     root            0 Feb 15 10:11 ../

Any idea what I am doing wrong?

P.S. I did set up the javawrapper etc., as per the kernel documentation...

--
-MM
                                               /"\
(No un-solicited email please.)                \ /     ASCII Ribbon Campaign
See following url,                              X      Against HTML Mail
http://pages.prodigy.net/mmynsted/spamoff.htm  / \

2. Security policies

3. Executable Binary File vs. Executable Script File

4. Login problem with gcc 2.6.2

5. executable JARs, Solaris execev() and java version

6. Open firewall for telnet to remote 25

7. java/43949: Port java/jump should install jump.jar in shared jars dir

8. Still Pondering that Win2k BSOD

9. ftp and jar-files (class files)

10. clearing jar files from netscape cache

11. Jakarta Log4J port and versioning of JAR files

12. [ANN] BSD licensed C++ library for reading jar/zip file

13. Does Apache serve JAR files ???