Wrapping Java applet jars AND RUNNING THEM!

2012-05-01
2013-06-12
  • Zachary1234
    Zachary1234
    2012-05-01

    Can someone please reply back and tell me,
    is it possible to program a java applet, set it up inside a jar file,
    obfuscate the applet on whatever OS webserver,
    and have the applet still run embedded in the web browser,
    on the client PC, using target operating System?

     
  • Zachary1234
    Zachary1234
    2012-05-01

    Hello, myself again.  I notice, to my absolute thrill,
    that java applets jars wrapped using launch4j
    can happily be run as applets in the target web browser,
    locally by linking through an html file, or via a webserver
    (irrespective of that OS) through the internet.

    Is it possible to wrap a jar executable to a wrapped result file
    for other OSes?  For example, when wrapping jars with
    launch4j inside Windows, may I target other non-Windows OS'es,
    particularly Mac or Linux compatible, or even Mobile phone
    OSes, without running another instance of launch4j on those operating systems?

    Is there a switch inside the program to change so my result executable
    will execute on a foreign target OS?

     
  • Zachary1234
    Zachary1234
    2012-05-01

    Also, by the way, I notice that when wrapping a jar file, the manifest main class entry,
    along with another mention of the main .class file, exist as mentions in plain text.
    inside the result wrapper file.

    Is there anyway to have these encoded or something so that they are hidden and not mentioned?

    Not that there's much to be done with only the main class name, apart overflowing the stack.
    Reflection can't go any further than the main method.

    ?

     
  • Zachary1234
    Zachary1234
    2012-05-01

    Also, by the way, I notice that when wrapping a jar file, the manifest main class entry, along with another mention of the main .class file, exist as mentions in plain text. inside the result wrapper file.

    Is there anyway to have these encoded or something so that they are hidden and not mentioned? Not that there's much to be done with only the main class name, apart overflowing the stack. Reflection can't go any further than the main method. ?

    By the way, the launch4j wrapped file seems pretty impossible to get .class file bytes out of.  It seems pretty not done
    to go backwards and get the jar file or classes again.  I havn't found any reverse programs for this on the internet.
    How irreversible is the wrapping process?  What does launch4j have to say on this?

     
  • Ian Roberts
    Ian Roberts
    2012-05-01

    Launch4J is simply a mechanism to add a Windows executable header to the front of a JAR file, no more and no less. Obfuscation is a separate issue and there are other tools that do this, but Launch4J will happily accept an obfuscated JAR file for wrapping, as long as you give it the obfuscated main class name.

    The ZIP file format (which is what JARs are based on) allows for a certain amount of non-ZIP data at the start of the file without affecting its validity, so a Launch4J wrapped exe is in fact still a valid JAR file that can be run on other platforms using java -jar, unpacked using standard ZIP tools, etc. (though you might need to rename it back to being called something.jar to get it recognised).

    Regarding wrapping for other platforms, no, Launch4J is just for creating exe files that target Windows. There are other tools that do the same job for Mac (google jarbundler) and possibly for some Linux distributions although it's less necessary in that case as modern Linuxes can execute jars directly with binfmt_misc.