my company creates a tool that is produced with java 6 and wrapped with launch4j.
Importantly we use the <customProcName> option to name the process under windows.
For testing I use Windows 7 with reduced user rights and jre7.
In this environment I experience a weird error:
If I start the application, immediatly close it, and then immediatly restart it, the launch fails with the following error message:
An error occured while starting the application.
The system can not find the specified file.
If such an error message appeared, exactly after 1 minute the process naming file in jre/launch4j-tmp disappears. Until then it is locked, and I cannot remove it manually.
However, if no conflict was produced the file stays, and exactly after 1 minute or if i manually remove the file immediatly, I can restart the program without error message.
Naturally I originally assumed that maybe some part of our program was still running and locks the file, however I failed to proof such a thing. Neither the task manager nor the jvisualvm can register any activity of our program.
I have now installed the correct jre for our tool, jre6, and the error disappeared.
Has anyone experienced a similar problem? Or does someone even know the cause for this behavior?
Thank you very much for your replies!
The removal of the java 6 version did restore the error. Thus I am not sure whether this was actually responsible for the disappearence in the first place.
One of our customers is seeing exactly the same behavior. The weird thing is, the executable has been running fine for years, on different windows platforms. This is the first time I hear customer complain and they are running on Windows 2008 SP2 Enterprise. Their deployment is a new one to the 2008 machine. We are compiling with jdk1.5 but jre is version 1.6.
Any suggestion? I have rebuilt them an executable with CustomProcName set to false. The exe is a console only app. This should avoid using the launch4j-tmp folder. Will find out if it works tomorrow (customer is in different time zone).
What I also notice is that even with CustomProcName set to false, the process name is still my executable name (which is what I want!)
The process name becomes javaw.exe IF my application is a GUI application.
Does it make sense?