Launch4J launch fails as expected
Tools: Win 7, Launch4J 3.5, Simple Hello world Java Console Application (bundled with JAR file)
Hello to all,
I have a main JAVA console application that doesn't ask for any inputs, just a simple application that opens a console window and displays the Hello World text.
I built it so easy to experiment with Launch4J 3.5 and create an executable from a jar file.
Everything looks fine, the exe runs successfully, but when I run it nothing happens, I get a watch glass for a few seconds, then nothing. I check Task Manager and there is no process there.
See my settings in Launch4J, I just completed the basics, I tried with and without writing to the Wrapper manifest field:
Output File: C: \ Development \ SFDC \ ProjectX \ out \ exe \ ProjectX.exe
Jar: C: \ Development \ SFDC \ ProjectX \ out \ artifacts \ ProjectX_jar \ ProjectX.jar
Wrapper exponent: C: \ Launch4j \ manifest \ uac.exe.manifest (also tried to leave this gap)
The rest remains by default.
source to share
If at startup you mean double-click, no - nothing you can see will happen; you need to "tell" Java to run the application using the appropriate console. To do this, you can create a new .bat file: just open a text editor and paste the following line:
java -jar NAME.jar
where "NAME" is the name of your application. Save the text file in .bat format, not .txt, and place it in the same directory as your application. You can launch the application by double clicking this file.
The reason it doesn't appear in your task manager is because probably (I don't know) your application only prints out a simple message and does nothing. In non-console mode, it will just call your print method (println or any other console) without any visual effect, since there is no console to print the message. In both cases, however, if you are just typing and not doing other "last" operations, such as listening for input, your program will exit when it reaches the end of the main method.
source to share