FAQ

Typical questions asked by Jar2Exe users


How to get more details of the error when generated exe fails to run?

If the exe file is generated as "GUI application" or "Service application", the console is not visible, so it is not convenient to debug when it fails to run, we do not know what is wrong.

There are 2 ways to get more detailed informations about the exception description:

  1. For "GUI application", you can create it as "Console application" for DEBUG, then you can get the exception on the Console window. For "Service application", you can use "yourprogram /test" at command line to run it as a console application.
  2. Another way, in the ".cfg" file, use a "stderr" to redirect the console to a file, for example "stderr yourprogram.log". Please refer to http://www.jar2exe.com/createdexe/intro/stdredir .

What is the mechanism of Jar2Exe?

Jar2Exe generate exe file by wrapping binary code around encrypted jar file. When a generated exe file runs, it starts the JVM and call the main method of entry point class. Jar2Exe does not compile java code into native code.

The binary code of generated exe files does not depend on MFC, STL, or VC runtime library on Windows, does not depend on GLIBC on Linux.

The independency of runtime library brings a good compatibility, but it lets the size of exe file a little larger, that the binary code is about 150kb ~ 300kb according the options. (While if the binary code depends on the runtime library, the size can reduce to 20kb ~ 100kb, but less compatibility.)


How to run generated exe on a computer without JRE installed?

When a 'jre' directory exists along with generated exe in the same directory, the generated exe will use the 'jre' directory first. The 'jre' directory need not to be INSTALLED, but just a COPIED 'jre' directory will work.

You can pack the 'jre' directory and your generated exe file into one install file, and let the 'jre' be extracted with your main exe file into the same directory. Since the copied 'jre' is justed copied, not normally installed by JRE's install file, other softwares cannot find it, so this copied 'jre' is a private JRE and used by your generated exe only.

  • See jvmdll page for more details.
  • See jre page for bundled jre.

Why "Java Environment not found" when generated exe runs?

1. JRE is required when generated exe runs. If you have not installed JRE, you can download it from http://www.java.com.

2. If you run generated exe files on 64 bits of Windows or Linux, please note that 32 bits of exe can run with 32 bits of JRE, 64 bits of exe can run with 64 bits of JRE.

3. On Linux, gcj is not supported.


Can generated exe file be re-encrypted by third-party softwares?

You can uncheck the "Self checksum" box at Step 6: Output if Jar2Exe is ACTIVATED, and then you can re-encrypt generated exe by third-party softwares.


Generated exe file cannot run after signed?

Same as to be re-encrypted, you need to unckeck "Self checksum" box at Step 6: Output, and then generated exe can be signed by 'signtool.exe' etc.


Why error "/lib/ld-linux.so.2: bad ELF interpreter" when generated exe file runs on Linux?

You're on a 64-bit system, and don't have 32-bit library support installed. You can install it like this:

yum install glibc.i686

Or

apt-get install ia32-libs

Where can I find the program version of Jar2Exe?

About menu is here:


Is there a free edition of Jar2Exe with basic features only?

Yes, those features without "Trial xxx days" are free to use:

  1. To create a console application without any of the "trial features" enabled, is free to use, the generated exe file will not expire after 30 days.
  2. At the bottom of License compare page, you can click the TrialPay button to click an advertisement, and then you can get a full featured license.

 

Comments

Please pay attention to class loader

The probable situation I have thought is that: have you packed depended jar files into a single “jar” file and then use this jar file to convert into exe file? If so, please do NOT pack your depended jar files into a single “jar” file, and instead, pack the depended jar files by Jar2Exe at http://www.jar2exe.com/usage/wizard/stepdepjars

If the above is not the reason, if yourself have used class loaders, please remember that, the protected jar files could not be extracted by your own class loader.

Windows Integrity Level - UIPI

In recent versions of Windows, User Interface Privilege Isolation (UIPI) implements restrictions in the windows subsystem that prevents lower-privilege applications from sending window messages or installing hooks in higher-privilege processes.

The program I package with this tool works to sent messages using the JNA WIN32 API User32.INSTANCE.PostMessage() on older JVM's and older OS's, but if the JVM is newer and OS is newer, it seems these inter process messages fail due to insufficient privilege.

Question: Is there something to be done in the build of the exe to cause the JVM to be higher privilege, or is that a function that is outside the scope of your product?

error example

hello

I want to convert webapp (war ) to an .exe file, read the web page tutorial " http://www.jar2exe.com/solutions/webapp "

but when you run the exe displays the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/catalina/s
tartup/Tomcat

my version of the software is 2.1.7 with license

thanks for the help

This problem is resolved

This problem is resolved finally. There are 2 ways to resolve:

1) Move away or rename the binary file to a different filename as the jar filename.

2) Download again the latest Jar2Exe and try again.

 

Lost History

Today when I built a project I'd never built before, my history got lost due to some corruption, I think.  The image shows the new project repeatedly added to the history, but with on character removed for each entry.

http://i.imgur.com/8GXRJFd.jpg?1

I see a file called j2ewiz.ini, dated 3/31/2015.  Could I take action to somehow restore my history using that INI file?

Corruption of History Resolved

You can search the whole C: drive for j2ewiz.ini , it is under C:\Users\<your user>\AppData\Local\VirtualStore\Program Files (x86)\Jar2Exe Wizard

At Jar2Exe's view, it is under C:\Program Files (x86)\Jar2Exe Wizard , but the Windows mapped it to your HOME directory for read-write.

Corruption of History

I am still encountering problems where the history of previous builds is repeated / corrupted.

When I use the drop-down on "Please input the jar file full path or classes directory:" item, instead of seeing one item for each project built in the past, I see one accurate item, then dozens of items that are corrupt.  These corrupt items appear to be a mixture of two build items.

This is a picture of what the corruption looks like:

http://i.imgur.com/uwPmiC4.jpg

Is it possible to offer a way to completely clear history to see if that helps?

Program Not Working

I have generated several .exe files that run perfectly fine and do the correct thing on my system but simply do not work when my friend runs them on his computer. It's the exact same file and my windows 10 laptop runs it perfectly fine but when he runs it nothing happens except a very quick flash of a window.

Runtime.getRuntime().addShutdownHook() apparently not running

Running my project from a built as a runnable jar (no jar2exe), I see that the code in the shutdown hook thread runs properly, but if I build as an exe (using jar2exe), the code in the shutdown hook seems NOT to run. 

Should the code in the shutdownhook thread be running, or is this a limitation of a program packaged using jar2exe?

EDIT: I have discovered that sometimes programs built with jar2exe do indeed execute the shutdown hook code.  I will try to narrow the differences, perhaps flush the output to stdout will help determine if the code is running.

I can not register the version anymore

My windows 10 updated tonight and now I can not register the version anymore. When I try to register again "Activate jar2exe have reached the number of licenses". I ask for urgent help, because I'm on a project and need it to work. Thank you

Those files are not your classes

What you see in WinRAR are not your classes.

When Java program starts, it needs at least one jar file as its entry point. Jar2Exe lets the exe file is a jar file at the same time. Please don't worry, those files which you see in WinRAR are not your own classes.

Pages

Add new comment