Menu

#39 Launch Java VM through JNI

Future
closed
None
5
2015-05-21
2007-02-28
Ryan Rusaw
No

Attached is a patch to launch the VM and Jar through the JNI API. This allows the removal of the Custom Process Name and Stay Alive configuration fields as they are no longer required.

Discussion

  • Ryan Rusaw

    Ryan Rusaw - 2007-02-28

    JNI Patch

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2007-03-10
    • assigned_to: nobody --> grzegok
     
  • Grzegorz Kowal

    Grzegorz Kowal - 2007-03-10

    Logged In: YES
    user_id=917657
    Originator: NO

    Thanks, I'll have a look at it!!

     
  • ital0dancer

    ital0dancer - 2007-03-21

    Logged In: YES
    user_id=1247043
    Originator: NO

    I would be very happy if this patch was integrated into 3.0.0 :)

     
  • Markus Schlegel

    Markus Schlegel - 2007-09-17

    Logged In: YES
    user_id=778375
    Originator: NO

    Does this patch also work on x64 ?

     
  • hilt2

    hilt2 - 2010-03-27
     
  • hilt2

    hilt2 - 2010-04-04

    implemented. Will be available in jLiftOff 3.1
    http://code.google.com/p/jliftoff/issues/detail?id=37

     
  • Björn Kautler

    Björn Kautler - 2011-03-24

    Using JNI has other important pros:

    - With UAC (Windows Vista and newer) you cannot copy the javaw.exe in the Java program folder for a custom process name as it is not writable for a normal user, with JNI you will not have this problem.

    - With the usage of JNI to launch the JVM it should be possible to correctly pin applications to the WIndows 7 taskbar I think which is not possible currently.

     
  • Anonymous

    Anonymous - 2011-07-05

    I tried to compile the patch but now if I start my executable now, it appers with the process manager with the right name but there is no application window. Can you help me?

     
  • Nathan Sweet

    Nathan Sweet - 2014-11-08

    Launch4j can't launch the JVM in the same process. This patch to add that is from 2007. 7 years ago! Any chance it gets merged? It's important because having many "javaw.exe" processes in Task Manager doesn't tell the user which is which.

     
  • Björn Kautler

    Björn Kautler - 2014-11-09

    @Nathan while I totally agree that this would be a good change, there is an easy workaround for the Task Manager issue. If users do not use the very limited standard Windows task manager, but a decent Task manager like Sysinternals Task Explorer and there add the command-line column, they can easily differentiate various javaw processes. I know, a custom process name would be preferable, but using the Task Explorer also has other advantages. :-)

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-01-05

    After upgrading the compiler I was able to compile it and got it running, but it requires some additional work and testing. I plan to release launch4j with the latest changes regarding new search options. Then I can focus on this. But the good news is that I was able to launch a simple application this way.

    Grzegorz

     
  • Nathan Sweet

    Nathan Sweet - 2015-01-05

    @Björn, needing users to install a better task manager isn't reasonable.

    @Grzegorz, great! The patch in this feature request is too large for me to be able to comment on, but FWIW you might also check out packr which has very simple code for launching the JVM on Windows, Mac, and Linux. Doing it right on Mac is particularly tricky.
    https://github.com/libgdx/packr/tree/master/native/src

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-05-09
    • Group: --> Future
     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-05-21

    Merged and working, but not everything was tested and there are some small problems. Both headers will be available: the stable classic one, and JNI.
    This uses the newer compiler version which may generate false positive virus warnings.

    Grzegorz

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2015-05-21
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB