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 try again with JDK 11

Is your screen "high density"? Are you running on JDK 8?

As I know before, it is because JDK 8 shows too small, not Jar2Exe show too big. JDK 11 will shows the same size as Jar2Exe.

If not so, please tell more about the OS version, JDK version, screen size etc.

When I shutdown my

When I shutdown my application, the exe created by Jar2Exe often continues as a zombie process (which I see in Task Manager).

I want how do I shutdown all traces of my application.

Thanks

Generated exe crashes in Windows XP, works fine with windows 7 +

Hello,

I have generated an exe using jar2exe. It is crashing with dialog saying '*** has encountered a problem and needs to shut down....'. This exe works fine on Windows 7 onwards. I checked .jar form which it was created, it runs fine on Windows XP. What is the problem here?

Regards

Ram

One of my JFrame java files will not run --runs fine in Netbeans

I have aprogram which run fine when compiled in jar2exe until I added another Jframe file to it. Works great in NetBeans 8.0.2 with the added file but seems that Jar2exe will not allow this one file to run from the main exe java program. Not usre what is the cause of the problem. Any suggestions? 

Unable to Generate Key

hi,

 

I am unable to generate key for my laptop and server is giving following error.

 

 

my user name is msibtain

 

 

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.regexlab.product.KeygenTools
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.regexlab.product.KeygenTools
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.en.regkeys.index_jsp._jspService(index_jsp.java:528)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NoClassDefFoundError: Could not initialize class com.regexlab.product.KeygenTools
com.regexlab.product.ProductKeyInfo.createKey(ProductKeyInfo.java:169)
org.apache.jsp.en.regkeys.index_jsp._jspService(index_jsp.java:126)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
Apache Tomcat/6.0.26

Windows 10: No icon, noc splash title

Same gif for splash screen and icon. Gif is shown in splash screen - but not the splash title.

Icon never appears.

I use the newest unregistered version.

Any suggestions?

Winrar preview

Even using the option to hide the jar files. It is still possible to open the exe with winrar, even if it only shows the Jar2exe files. Is there any way to prevent this?

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.

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

licence

does this tool support licenc?e.

I need , once install my java apllication for computer .it cant be use for any other computer

Jar2EXE killed by AVG

I have used AVG for years as well as Jar2EXE, but on the last update of AVG (17.5.3022) , it now intercepts and kills Jar2EXE complaining that it is infected with a virus. Yes, it's probably a flaw in AVG, but I would suggest contacting AVG to get this resolved!

Not able to move licenses to another computer.

Hello,

I recently formatted all my computers, now I am unable to activate, it gives me error that I have reached number of licenses.

Please do the needful.

 

Regards

Ram

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.

sqlite

Hai how to make exe with sqlite database.is it necessary to add lib in dependened jar files.how to add other txt and pdf file with exe

Jar2exe Encryption can be evaded

Can shield the function of JVM javaagent etc?
Because the parameters can be easily get into the JVM bytecode, lead to protect
Thanks.

Desktop icon goes back to java coffee cup

Works perfectly except for the icon.  And that is the only reason I'm interested because I have all the rest in a runnable jar.

So, much to my surprise, even when I got the shortcut on the desktop to match what was compiled with jar2exe, as soon as I ran it

the icon changed to a windowed coffee cup.  Cannot purchase unless this is fixed.

Spring Boot

I encrypt an spring boot application what is a single jar with all dependent libraries inside.  

It run good as jar but when I generate the exe file it does not work.

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
ore/io/ResourceLoader
Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resourc
eLoader
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
The main startup class could not be found.

Java Runtime Environment Not Found

Hi,

I am using Jar2Exe. When I generate .exe, it is working fine in my system. But in some systems, it is showing Java Runtime Environment Not Found message even though JRE is installed in their system.

What is the problem with it and how can I fix it?

Thank you,

Karthej

swift payment

Dear Sir,

I am from BNP Paribas Turkey. We would like to buy below product urgently.

Could you please inform us whether you accept SWIFT bank transfer ?

Product: JAR2EXE.COM Standard License

Qty: 1

Price: 145 USD

 

Thank you,

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.

When copying the .exe file program opens up but no content/empty

Hi there, 

I was trying to copy my exe file to an external and run it from another computer. Program open up but window's empty, doesn't run.

Is there something I'm missing here?

Does the exe still need to be in same location as the lib folder?

 

Grateful for any help!

 

webapp with spring

hello,

this week,i am trying to study how to use jar2exe to wrap and encrypt webapp spring project.

i can do it fellow the solution advice:Webapp,which is the project of tomcat\webapp\examples,

but failse,when i do it on my simple webapp project,with the srping,this project just pring helloworld.

the error msg is:

warning:cannot search for matching files underneath url[j2e:libs/web-inf-classes.jar!com/demo/web/controllers/] because it does not correspond to a directory in the file system

java.io.filenot foundexception: url[]

 

 

please help,tks!

 

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?

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.

Pack .DLL file

Hi,
Can I pack inside my .exe file .DLL files?
Thanks,
NG

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.

 

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?

Exe is Not running after Hide/Encrypt Class files

Hi

  The exe generated is not running after the checkbox Hide/Encrypt Class files is checked. Otherwise it is running fine. But the soul purpose of Encrypting class files is not working.

 

rgds

GK

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.

JavaFX executable

Hi,

I am trying to convert a JavaFX application with Jar2Exe into an executable. I have done all the steps in your advice, but still no success. When I start the final executable, it says: "JavaFX launcher error - Unable to invoke main method". 

I have added the binaries of fx.jar to the binaries of my application. Is that necessary? 

The command line version of what I've tried is this: 

"C:\Program Files (x86)\Jar2Exe Wizard\j2ewiz" /jar D:\Software\FSS\dist-bin /o D:\Software\FSS\dist\KnowledgeMap-0-6-1.exe /m com.javafx.main.Main /type windows /minjre 1.8 /platform windows /encrypt /checksum /amd64 /pv 0,6,0,1 /fv 0,6,0,1 /ve ProductVersion=0,6,0 /ve "ProductName=Knowledge Map" /ve "LegalCopyright=Copyright (c) 2014 - 2015" /ve "SpecialBuild=0, 6, 0, 1" /ve FileVersion=0,6,0 /ve "FileDescription=Knowledge Map" /ve "LegalTrademarks=Trade marks" /ve "InternalName=0, 6, 0, 1" /ve "CompanyName=ForeKnowledge GmbH" /config "libs lib" /keepflat D:\fx.jar|META-INF\*|com\javafx\**

Any help / hints would be very much appreciated. 

Best regards

Walter

Solaris support

Does Jar2Exe support Unix/Solaris?

Splash Screen Does Not Show

The splash screen was working in 1.3.  I upgraded to 2.1 and I no longer see the splash screen.

When building the .exe file (using  "Windows GUI Application"  type), I click the 'test' button, and I see the image, but when I launch the application, the image does not show.  Although this application does not have a GUI, I know the application is running since it responds on the ports it monitors.

Please use 'gif', 'png' or 'jpg' file

Since Jar2Exe v2.1.2, the generated exe file will use the "splash" feature of JRE instead if it is running with JRE 1.6 or above.

The "Splash" of JRE requires a 'gif', 'png' or 'jpg' file, so please try again.

I'm so sorry Jar2Exe does not limit this or clarify this.

JAVA OPTION

Dear,

I hava two questions:

1) How to set "-Dfile.encoding=UTF-8 -Djava.encoding=UTF-8" in exe file?

2) In my jar file exists several *.jar so I dont use external lib,yet when I want to make exe file and be run correctly I have to set external lib. How to make exe file without set CLASSPATH with external lib?

Regards,

Saeed

Please use a config file or internal config

1) Every exe file can have a corresponding config file, which is a text file with the same filename as exe file and an ext name ".cfg". The contents of config can also be put internal at http://www.jar2exe.com/usage/wizard/stepoutput .

In the config, you can use a line "option -Dfile.encoding=UTF-8" to set an option. See http://www.jar2exe.com/createdexe/config/option

2) If your jar file already has other jar files in it, you must have used a classloader to load them, we can call your jar file a "fat jar". If your whole "fat jar" is converted to exe by Jar2Exe, your program may not work because the jar files in it is encrypted by Jar2Exe.

First, you should create a jar file does not contain depended jar file within it. Then at the step 5 ( http://www.jar2exe.com/usage/wizard/stepdepjars ), you can add those depended jar files into exe file together. Jar2Exe will pack them together in Jar2Exe way.

i want to convert an jar file to exe

hi

i  wnat to  convert  a .jar file  on  my  system  to  exe  to  be able to  run  it  on  my  pc (windows xp installd and java 7.1 )

but  i  dont  know which  class should  i choose in  step  3?

and  anfet converting  my  jar  file  i  have  a class missing  error

how  can  i  found  correct class?

cant  main  program  select correct class automatically?

The class which has "main()" defined

The "main java class" means the entry point of your java program, which has the "public static void main(String [] argv)" defined.

Jar2exe run with script get problem

hi, my project use javax.script.* to dynamic load .java execute as a script files,the script java files need import some classes from the main jar,when i use jar2exe packed my jar the script got error(cannot found the import class),is there some solutions for this?

Jar works correctly - exe after jar2exe has function erro



Hello,

I use jar2exe to convert my jar files (several with dependencies) to executable module.  Using the jar (main start module) everything works great.  But after I convert to exe and run the program using the EXE module, there is one repaint function - for a JPANEL that is not working...everything else does.  Why does it WORKS using java jar to run, but doesn't give me the Jpanel screen with my data only, but does NOT WORK after converting to exe? 

Did I missing some module?  Is something odd about java panels or repaint components?

I am running V2.1.6.1059 - hope that helps.

Thanks for any assistance on this!!

 

-Tony

Maybe some details with ClassLoader

Encrypted classes and resources are loaded through a different ClassLoader. From you description I could not tell the exact reason. Please contact me by email  support@jar2exe.com

Please try convert without any hide or encrypt option.

How to make my genereted exe file to be excuted as admin.

Hello again!

I want to know how can i make my generated .exe file to be excuted as administrator. OR if there is any means of code in java.... please let me know. I wanted this cause, I want my java program to modify it's configuration file which will be found in the same directory as my .exe genereted java program. I have just tried to normally generate the .exe by normal procedure and then when i try to execute it, it always says "Access denied"..... but when i right click on my application and try to execute it by choosing run as administrator, it works fine. so please I don't want to run it always in that way, I want it to be executed directly as administrator.

So, please if you mind, let me know how can i just get that work.

Thank you!

Pages

Add new comment