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

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?

dynamic load

I have the same question,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  [email protected]

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!

.exe file won't start

I have a java program which I have successfully converted into a jar.  When I use JAR2EXE, and try to execute the result, iget the message  "The Main Startup Class Could not be found".

As a console application the fault is

Exception in thread "main" java.lang.unsupportedClassVersionError: Baboon :Unsupported major.minor version 52.0

(My main class is Baboon)

This seems odd, because yesterday the trial version worked. Then I registered it and ...

PLease comment.  Thanks

 

 

Please use a lower version of JDK to compile

The error message "unsupportedClassVersionError" means that, the JRE to run with is lower than the JDK to compile with.

You can use a lower version of JDK to compile, or specify a "-target" version when compile.

Please refer to the "-target" argument of 'javac'.

Won't start as service

I can start the exe as console app, but not at service.  When I start the service, this is the error.

Errno::ESRCH: No such process - C:\Library\Group Containers\GEAJ47UQTT.com.ZaHueController
       mkdir at org/jruby/RubyDir.java:577
  initialize at shared/file_manager.rb:17
        load at manager/hue_bootstrap.rb:38
      (root) at bin/hue-lights-controller.rb:84
        load at org/jruby/RubyKernel.java:1046
      (root) at file:/D:/hue-lights-controller/winhue.exe!/META-INF/main.rb:1
     require at org/jruby/RubyKernel.java:1027
      (root) at jar:file:/C:/Windows/TEMP/jruby1164722044564878426extract/jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1
     require at jar:file:/C:/Windows/TEMP/jruby1164722044564878426extract/jruby-stdlib-1.7.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36

 

Anyway to include an external jar with output exe

In My application, there is an activation mechanism, which uses BountyCastle (bcs.jar) for encryption and decryption. If I include bcs.jar while constructing the output .exe of my application, it won't give any problems. But when I activate it, it gives out exception related to BountyCastle

java.lang.SecurityException : JCE cannot authenticate the provider BC

usually this error occurs if the used bcs.jar is extracted, because that way, the Signature of encryption is lost( I think if you google this exception, you can find out about this exception). This can be solved if we don't extract the bcs.jar and just use it from an external source as a jar file. So is there anyway to use the depending jar files without wrapping them or use them from an external source.

Please help!

關於保護的力度

我關心的問題是 使用您的產品 有沒有辦法防止反編譯這問題

這是我最關心的問題 對於產品的知識產權 使用您的產品有沒有辦法得到最有效的保護力度 防止反編譯

混淆機制 我已經有做了 請不要在叫我做混淆 我做的程序是服務端 運行在windows server os system X64

 

Jar2Exe 進行了兩種處理

Jar2Exe 並不是將 java 轉換成 native 代碼。運行的時候,利用特殊的 ClassLoader 按照 Java 的方式運行。Jar2Exe 進行了兩種處理:

  1. 對 Jar 進行了加密,分析 exe 文件的內容中無法提取 jar 文件。
  2. 在加密 Jar 文件之前,對 Jar 內部的每個文件名進行 hash 處理,無法逆向恢復 Jar 內部每個文件名。

在進行 Jar2Exe 處理之前,可以增加混淆處理,您提到您已經做了。Jar2Exe 處理之後,可以再進行 Exe 的加密。請參照:http://www.jar2exe.com/solutions/safety

由於最終仍然採用 Java 方式運行,可能我們很難 100% 防止破解,但我們可以儘可能增加破解的難度。

Can't execute jni

I have jar file that work depends on my dynamic link library, and it works fine when I execute the jar file which is placed in the same folder with my dll file by cmd in windows os. But when I convert it in to exe with jar2exe tool and place the exe file and dll file within the same folder and execute it wont work. I have coded in my java file..... System.load(System.getProperty("user.dir")+"\\mylib.dll"); .... and I have also changed "user.dir" by "application.home" and tried it won't work too.

So please help me how do I get that work?

Please pay attention to the 32/64 bits

From your description, to change "user.dir" to "application.home" should be correct. The "application.home" is the folder where the executable is. The dll file should be in the same folder as the executable.

So, please pay attention to whether the 32/64bits matches the dll. The executable can only load the corresponding 32/64 bits of dll.

Thanks

Thanks a lot!
It is worked for me, when I finally change my dll file to 64 bit and do that with my jar2exe 64 bit...!

Curious..

Hello Tech Assist, I'm just wondering if there's any possibility to encrypt and still retain/save as a jar file?

I'm trying

Some other customers requested the same feature, but now I have not found a way to implement this. I'm also trying to find an equivalent way which will not cause too much change to the original solution.

You can also take a look at http://proguard.sourceforge.net to see if it can satisfy you.

Welcome to contact me if any advices or problems. 

Virtual Machine

I'm a linux user and I'm trying to develope my projects for windows, so I have a virtual machine where I want to have installed jar2exe. I have four licenses, but I had to format my computer keeping my virtual machine saved. When I tried to use again jar2exe, tells me that I have the limit reached, and I will not spent more money buying more licenses. What can I do to run jar2exe again?

Now I have enabled your activation on new PC

By default, to activate on a new PC will be enabled after each month.

The register key is bound to certain CPU, so if you run the virtual machine on a different real machine, you need to re-activate it. Please contact me if you need to activate on a new PC but failed.

Hi,  

Hi,  

When I start converted programm, I have exception -  "Couldn't create URL for the file path : constant.ini",

where constant.ini - it's external file.  Although, runnable jar normaly find it.

Please care about the ClassLoader

According to your description, I could not tell exact the problem. There are 2 points to care about:

  1. The ClassLoader, if the converted exe file is generated with encryption option enabled, the classes and reources are loaded through 'Jar2ExeClassLoader', the URL is not begin with 'file:' nor 'jar:', but 'j2e:'. If your program try to parse the URL, the URL may be unknown to your rogram.
  2. If you need to know the real path of converted exe when running, please use 'System.getProperty("application.home")'.

Yes, it is compatible with Java 8

You can run generated exe file with Java 8.

The java version select dropdown on the step 1 is editable, you can type 1.8 by yourself right now.

change password failed

I want to change my pass but all i receive is error PDOException: SQLSTATE[HY000]: General error ...

from you page your database is corrupted

 

Exe from JavaFX-JAR

Hi,

is it possible to generate a exe-file out of a javaFX (2.2+) JAR?

Both will be kept

Usually, external config will override internal config.

But for `option` and `classpath`, it cannot override, because `option` and `classpath` are allowed to repeat. I'm not sure how it will be if there are more than one `-Xmx`.

But I think your idea is good, I will try to let the external `option` to override corresponding internal one in the future.

Don't worry about it

The generated exe file contains 2 parts: some binary code and a jar file, its structure is something like a self-extracting program. I don't know why 'Dr.Web' will regard it as a virus.

Please make sure you downloaded Jar2Exe from this site http://www.jar2exe.com/downloads , then you need not to worry about it.

 

make the exe to run on javaW

Hi ,

I am usin jar2exe to convert my to exe. it is working fine.My requirement is i need exe file like that it always run using javaw instead of java.Could you please let me know how we can achieve by using jar2exe?.This requirement is because while executing i dont require to wait for response.

Regards,

Thulasiram.S

Dear, please select 'Windows GUI' type at step 2

Generated exe file does not use 'java' to start, nor 'javaw', but it use 'jvm.dll' to start.

If you don't want the Console window to be visible, please select 'Windows GUI application' at step 2.

unable to import the images

The images used as background for jframes and for jframe icons are not displayed after creating and running the exe file. Suggest a solution please.

There are 2 tips

Thank you very much for your message. There are 2 tips for 2 ways to add the image respectively:
 
1. Use "Thread.currentThread().getContextClassLoader().getResource()" to load the image if the image is in jar file.
 
If the image file is in classpath (in the jar file), you can load the image through ClassLoader.getResource(). Then please be careful to use this classloader "Thread.currentThread().getContextClassLoader()".
 
2. Use "System.getProperty("application.home")" to get the exe folder if the image is in disk.
 
If the image file is in disk, you select to load the file by full pathname. Then you can use "System.getProperty("application.home")" to get the folder of exe file.
 
I have write a demo program to show the background image and icon image, you can download here.
 
Please don't hesitate to contact me if your solution not succeed.

Pages

Add new comment