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.
- 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@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. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
JNI Patch
Logged In: YES
user_id=917657
Originator: NO
Thanks, I'll have a look at it!!
Logged In: YES
user_id=1247043
Originator: NO
I would be very happy if this patch was integrated into 3.0.0 :)
Logged In: YES
user_id=778375
Originator: NO
Does this patch also work on x64 ?
the issue was copied to http://code.google.com/p/jliftoff/issues/list
implemented. Will be available in jLiftOff 3.1
http://code.google.com/p/jliftoff/issues/detail?id=37
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.
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?
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.
@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. :-)
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
@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
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