Technical Support

Usage

Jar2Exe can run in Wizard mode and Command line mode.

Get detailed usage of Wizard mode, command line mode and generated binary files.

Configurations

Parameters can be configured to generated binary executive, such as Java VM parameters, system properties etc.

This is the descriptions of configurations, including overview introductions and detailed syntax.

Integrate API

To integrate with generated exe is not necessary. But if you want to let some of the enhanced functions to work, you need to do a little of integration. Every api to integrate is very simple.

This is the introduction and usages of API.

Demos

You can learn to use Jar2Exe by referring to the demo programs.

Solution advices

Typical usage of Jar2Exe with detailed steps and live demos in practice.

Such as console tool, desktop window, background service, webapp etc.

 

Services

Activate

After purchased, you need to activate Jar2Exe before you use Jar2Exe to generate exe files for redistributing. Activated Jar2Exe will authorize generated exe to run as a product.

This is to tell you how to activate.

FAQ

Typical questions asked by Jar2Exe users.

 

Comments

Warning about archived non-system classes

Hi, 
I am currently using Jar2Exe 2.2.4.1206. I recently upgraded my Java environment from Java 11 to Java 17. When I started the service I have built with Jar2Exe, the following warning came up:
"Java HotSpot(TM) 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "com.regexlab.j2e.Jar2ExeClassLoader"). To use archived non-system classes, this property must not be set"
Questions:
- is this a serious problem or can it be ignored
- if serious, how can it be solved

Thanks for help
Walter

Getting Segmentation fault (core dumped)

I have compiled my Java code and created an Exe for Linux. When I run it on my Linux server, I get the Segmentation fault error.
After further debugging, _findfirst(char const*, _finddata_t*)(): seems to be the issue.
Could it be because of issue in the Java code or in the Jar2Exe program?

Could please tell me more info

Thank you very much for your information. Could you please tell me more about the problem:

Which Linux release, which version of JDK, which edition of exe 32 or 64 bits? Which version of Jar2Exe?

Failed to run

Hi, nice to meet you. I have a problem, exe result won't run. Compiled using open jdk 17 (temurin), and run it on windows 10, using open jdk 17 (temurin). 

------ 

java.net.MalformedURLException: unknown protocol: j2e
        at java.base/java.net.URL.<init>(URL.java:681)
        at java.base/java.net.URL.<init>(URL.java:569)
        at java.base/java.net.URL.<init>(URL.java:516)
        at com.regexlab.j2e.Jar2ExeClassLoader.getJ2eClassPath(Jar2ExeClassLoader.java:37)
        at com.regexlab.j2e.Jar2ExeClassLoader.<init>(Jar2ExeClassLoader.java:27)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at java.base/java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1983)
        at java.base/java.lang.System.initPhase3(System.java:2246)
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: UNKNOWN; line: 1, column: 0]
        at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4145)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4000)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3070)
        at id.co.zytech.mc.apps.mcupdater.readConfig(mcupdater.java:40)
        at id.co.zytech.mc.apps.mcupdater.main(mcupdater.java:82)
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "id.co.zytech.mc.apps.UpdateConfigBean.getLogoAplikasi()" because "this.config" is null
        at id.co.zytech.mc.apps.SingleAppsUpdater.initComponents(SingleAppsUpdater.java:112)
        at id.co.zytech.mc.apps.SingleAppsUpdater.<init>(SingleAppsUpdater.java:68)
        at id.co.zytech.mc.apps.mcupdater.loadUpdater(mcupdater.java:68)
        at id.co.zytech.mc.apps.mcupdater.main(mcupdater.java:84)

Thank you for your message

We will try to re-produce the problem and fix this problem.  If convenient, could you send me a simple demo program like yours to show the problem.

Application crashes when encryption is enabled

Hi,

I've got 160MB jar file with lot of textures and resources. When I am trying to converto it to exe program works fine for few minutes but than exits without any message. Is there any way to find out what happened?  This is on windows 11, java 19.

Maybe the files within your

Maybe the files within your jar is more than 65535 files.  Jar2Exe currently does not support zip64 format.
Could you try to keep part of your depended jar files out of exe file and let the embed part smaller, and then add them to 'classpath'

problem with the same version of Java in PATH env variable

In Windows, in the PATH I have the path of this version of Java: C:\Program Files\Java\jdk-17.0.2\bin in order to be able to execute the java command to run jar files.

I created an exe file with jar2exe using the jre locally in the exe folder, and that jre is the jre-17.0.2

When I run the exe file in console version it shows this error:

Exception in thread "JavaFX Application Thread" java.lang.InternalError: platform encoding not initialized
        at java.base/java.net.Inet6AddressImpl.getLocalHostName(Native Method)
        at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1628)
        at org.apache.logging.log4j.core.util.NetUtils.getLocalHostname(NetUtils.java:54)

that comes from log4j library

the case is that when I change in the PATH env variable from C:\Program Files\Java\jdk-17.0.2\bin to another version of java: C:\Program Files (x86)\Java\jdk-16.0.1\bin

if I execute the exe file there is no problem

Is there any way to fix this?

part of the config to generate the exe file is this:

/type console /minjre "1.8" /platform windows /checksum:false /amd64 /config "jre_order c" /config "forcecwd ." /config "jvmdll jre\bin\server\jvm.dll" /config "option -Xmx1024m"

can I add some config to handle this error when the PATH env variable has the path to the same Java version in another folder?

It's fixed

I created a test case that demonstrated this problem. The developer found/fixed the problem and I can verify that version  2.5.5 no longer has the "platform encoding not initialized" problem for me.

I have the same issue

I commented about this in detail under the config jre_order on this site (https://www.jar2exe.com/createdexe/config/jre_order). I found a couple ugly workarounds but I think the root issue is that Jar2exe is not calling SetDllDirectory with the jre\bin folder before trying to load the jvm.dll. I've experimented *A LOT* and the only two solutions I can find until the product is updated is to compile into and run my EXE from my bundled jre\bin folder and set the jvmdll to ./server/jvm.dll OR to modify the PATH before my EXE runs. Neither of these are good solutions to me.

Try to add export PATH=

Take a try to add "export PATH=" in config file.  At command line: /config "export PATH="

Hello again, more info on export PATH not working

Hello,

In continuing to debug this issue and we reviewed the Amazon Corretto Java 11 source code. We understand the platform encoding exception as shown in my previous comment to you, but don't know exactly what issues Jar2EXE is having using the instructed JRE. We have always used the /config "jre_order b" configuration and placed a JRE in the same folder next to your generated executable named "jre". We tried the /config "jre_order c" and pointed directly to the JVM DLL. We've tried /config "export PATH=" to clear the path as you instructed to the other individual on this thread. All to no avail.

 

It appears as though if the PATH has any other JRE's, Jar2EXE simply fails to properly initialize. Being that we've said to use the specific JRE by way of /config "jre_order b" to use the bundled JRE (as we have for years), it should be enough. Additionally, we've tried the config options:

/config "export PATH="

/config "export PATH=./jre/bin"

/config "export PATH=/jre/bin"

but it seems as though Jar2EXE simply is not honoring these. Wtih all of this being said, do you have any other suggestions or a timeline on an updated version of Jar2EXE that addresses this issue?

 

Thank you for your time!

Joey Prevo

 

I have a new question related to charset

I have created two simple applications in Java. the first is a Chat Server, the second application is the Chat Client for the server.

I have created the executable files for the two applications (Server and client) and its work well as "console applications" (for now I use the Scanner.in object) but when the Strings have special chars (for example à, è, ù, ecc.) the client or the server receive the question mark (?). In which mode I can solve?

If I use directly the jar library I don't have problems.

Kind regards,

Enrico

Which OS, which terminal, which java version?

On whichi OS, windows / mac / Linux ? Which terminal, PowerShell or cmd.exe or PuTTY etc ? Which java version ? 

Usually, that is because the "file.encoding" does not match the charset of your terminal.

Spring Boot Webservices Exe is not responding

Dear Support Team,

I have created webservices.exe from webservices.jar file where exe is running perfecly, and also showing port number where is listening.

but webservices.exe is not entertaining any webservice request.

Kindly help to resolve this issue.

Java Runtime Environment not valid

I use:

netbans

java 17

java Fx 18

gradel 7.3

I use your Fx tool : C:\Users\Jupp\Documents\NetBeansProjects\VTDESKTOP_SETUPDATA\ModFxStarter\fx.jar|META-INF\*|com\javafx\**

 

Get the following Exception when run in consol:

at org.springframework.boot.loader.MainMethodRunner.run(Unknown Source)
        at org.springframework.boot.loader.Launcher.launch(Unknown Source)
        at org.springframework.boot.loader.Launcher.launch(Unknown Source)
        at com.regexlab.j2e.Jar2ExeLauncher.main(Jar2ExeLauncher.java:48)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class org.joobsoft.vt.MAIN.MainFX
        at javafx.graphics@18.0.1/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:891)
        at javafx.graphics@18.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at javafx.graphics@18.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:803)
        at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
        at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at javafx.graphics@18.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at javafx.graphics@18.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics@18.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        ... 1 more
Caused by: java.lang.NoClassDefFoundError: net/lingala/zip4j/exception/ZipException
        at org.joobsoft.vt.MAIN.MainFX.<init>(MainFX.java:75)
        ... 14 more
Caused by: java.lang.ClassNotFoundException: net.lingala.zip4j.exception.ZipException
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
        at com.regexlab.j2e.Jar2ExeClassLoader.findClass(Jar2ExeClassLoader.java:107)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 15 more

 

What is the reason ?

 

 

javafx in intellij to exe

Hi,

I have a javafx desktop application that was coded in intellij IDE. I need to know before purchasing jar2exe if I can use it to built an exe for my application and also hide and encrypt. I read sth about e(fx)clipse and ClassLoader, but I really don't know how to adopt it for my application.

Thanks

You can try all features before purchase

JavaFX changes a lot between different version of JRE. The document introducing e(fx)clipse on this site is old. The deploy of new version of JavaFX is much simple.

In Java 8, you need not to do special steps to run JavaFX or SpringBoot+JavaFX, just regard JavaFX as a common java program.

You can try all features before purchase.

Jar2Exe Requires Java installation on the other PCs?

Just to avoid to waste my time, I want understand if it's possible to use Jar2Exe to create an executable application from my Java application avoiding the installation of JVM on other PCs.

Kind regards.

Enrico

MacOS app not working when code signed

Hi I purchased Jar2Exe as the free trial limitation does not show the self checksum checkbox and I kind of figured this needed to be cleared in order for subsequent codesigning of the app to work correctly.

It seems that I might be wrong as now with the full license and "sef checksum" unchecked I still generate a perfectly working app

THAT IS UNTIL I CODESIGN IT

So codesigning obviously modifies the executable (by appending the signature block at the end) and NOTE I figure its some sort of self extractor executable!!!

codesign --deep --force --timestamp --sign "Developer ID Application: My codesigning ID"  MyApp.app

Normally I would also add the hardened runtime option and also notarize the app but since I figure its just the codesigning which messes it all up I tried just signing on its own!

Once the app has been signed (and I'll wager that actually just adding anything to the end of the exe file will bugger it up) thats it GAME OVER - the app wont work.

So since signing and notatarization are mndatory or MacOS apps I ask the following question.

HOW DO I CODESIGN and still have a usable app?

 

I note that if I codesign (never mind even getting as far as notarizing and stapling) THEN the (launcher app itself) crashes like this....

Process:               Terra-DV [8368]
Path:                  /Volumes/VOLUME/*/Terra-DV.app/Contents/MacOS/Terra-DV
Identifier:            com.bluespider.Terra-DV
Version:               3.16 (20)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Terra-DV [8368]
User ID:               501

Date/Time:             2022-03-28 17:45:58.063 +0100
OS Version:            Mac OS X 10.15.7 (19H15)
Report Version:        12
Anonymous UUID:        A234910C-CE4C-CF68-4926-2918B5E752E7

Time Awake Since Boot: 350000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000e0aa3aaf
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [8368]

VM Regions Near 0xe0aa3aaf:
-->
    __TEXT                 0000000107266000-00000001072c8000 [  392K] r-x/rwx SM=COW  /Volumes/VOLUME/*/Terra-DV.app/Contents/MacOS/Terra-DV

Application Specific Information:
dyld2 mode

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib       0x00007fff68bf8bb0 _platform_strncpy + 112
1   com.bluespider.Terra-DV        0x000000010726b9a0 CSettingsLoader::AppendInnerRemark() + 224
2   com.bluespider.Terra-DV        0x000000010726affb CSettingsLoader::Init() + 539
3   com.bluespider.Terra-DV        0x000000010726ace2 CSettingsLoader::CSettingsLoader(signed char) + 114
4   com.bluespider.Terra-DV        0x00000001072a2619 main + 57
5   com.bluespider.Terra-DV        0x0000000107267954 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000aaf  rbx: 0x000000002a22f4c7  rcx: 0x0000000000000055  rdx: 0x000000002a22f4c7
  rdi: 0x00007fefb0400000  rsi: 0x00000000e0aa3aaf  rbp: 0x00007ffee89993e0  rsp: 0x00007ffee8998f78
   r8: 0x00007fefb0400000   r9: 0x00000000000007fb  r10: 0x000000000000001e  r11: 0x00007fff68bf8b40
  r12: 0x0000600001e89bc0  r13: 0x0000000108fb7000  r14: 0x00007ffee8998f88  r15: 0x0000000001d1bf7a
  rip: 0x00007fff68bf8bb0  rfl: 0x0000000000010206  cr2: 0x00000000e0aa3aaf
 
Logical CPU:     4
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14

 

Now I note from the call stack that this has to be in the generated MacOS laucher App since the call stack shows what appears to be C++ code and matches strings present in the generated executable. 

I also note that as long as I dont use the encrypt option that the executable can be launched as if it was the jar file itself

e.g

java -jar exefilename

UNLESS it has been signed!!

in which case you get  something like this...

java -jar Terra-DV.app/Contents/MacOS/Terra-DV

Error: Invalid or corrupt jarfile Terra-DV.app/Contents/MacOS/Terra-DV

I await your advice as I do not wish to conclude that for MacOS this product is unfit for purpose.

 

 

Kind regards,

Dave

 

 

 

 

 

 

OpenJDK 15 Support

Does Jar2Exe suppport JDK 15+ ??? We are using Open JDK 16 to develope out apps. 

encryption

Hi Team

We are using purchased version of Jar2Exe. We have enabled encryption for the jar. Can you share some data related to type of encryption used and how secure is jar after encryption?

Encryption

V2.2:  the encryption is :   filename hash  +  jar file encryption

V2.5:  filename hash + 2 times of file encryption

When program runs, no temp file will be written.  The decryption is in memory.

encryption

Tq for the response. We are using v2.5. Please provide us more details on below.

1. Type of encryption used(AES/RSA/other)

2. key formation 

3. please elaborate - filename hash + 2 times of file encryption

Use Jar2Exe with VMProtect

Hello, can I use my Jar2Exe executable with VMProtect? Are there any extra steps I need to take to make it work?

Failed to Convert to .EXE

Hello,

I have been using .exe app from 3 years, recenlty after updating to V2.5 unable to convert to exe, I'm using same jar file which converted successfully in previous version of .exe.

Please help me, I'm  stuck in middle.

Thanks

Lost drag and drop

Hello

I have a java app that uses drag and drop function, the jar file run correctly but after convert to exe using jar2exe drag and drop functionalities now missing, any solution?

Which OS?

Thank you for your message.

Which OS? Could you send me a demo java program to show "drap and drop"?

Jar2exe close emergency

Hello I've perchese your software years ago it to generate exe. But my software has been haecked I was asking is there a way to track and code the exe files . So is been able to open as of it was a trail version of yours??
If possible let me know and cost involved.

Thanks.

BCEL error

I created an executable from war with the last version (2.2.4), the creation is done without error messages. But executing the exe file a message is showed and no service is started.

The Error is:

Exception in thread "main" org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
        at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
        at org.apache.tomcat.util.bcel.classfile.ConstantPool....

The exe file uses apache tomcat 7.0.8

Which version of Java are supported?

Java must be 32 or 64 bits?

 

 

 

Some framework may be not compatible with encryption

When encrypted, it is not allowed to get content of ".class" file by getResource. But some framework will try to load .class and do more by themselves, such as spring. 

So, we could choose to partially encrypt our program, and let those class which need to be loaded, not encrypted.

Standard License

Hi, I have a question for Standard license.

Once I buy the product, how many users are allowed to use in our company?

Unlimited

For Standard License, the number of PC is unlimited in a company.

JXBrowser

Hi, I'm using jxbrowser and it doesn't allow me to convert jar to exe anymore, it just stuck and crash!

UTF8 default font issue

Hi.

When I am using jar file wrapped into your executable - it ignores file.encoding=UTF8 JVM property in Config Internal and writes junk characters into a file.

When the same jar file is used directly : java -jar -Dfile.encoding=UTF8..  jar.jar - it works fine.

 

Could you please advise.

 

Thank you

Mac Executable

Hello,

I tried to make executable for MAC, but it doesn't work.

Please help me on this

Mac Excutable

Thanks for reply, Yes i did 64 bit executable, but i don't understand 2 point. Please explain steps to make MAC executable and running on MAC

Need to `chmod +x` when copied to mac

On Linux and Mac, executive files need to have execute privilege to run. Right now, Jar2Exe can run on Windows only, but FAT32 or NTFS could not express the `execute privilege`. So, after generated exe file is copied to Mac, we need to use `chmod +x (binary file)` to add execute privilege to let it runnable.

Generating for Mac ok but when I codesign the executable

hi

I'm using Jar2Exe fine in most cases but have hit a slight problem when generating for "mac" and applying codesigning to the executable.

to codesign I run

          codesign -s "MyCompanyID" ./MyAppExecutable

But when I run this I get

$ ./MyAppExecutable

Error occurred during initialization of VM
java.lang.Error: java.lang.ClassNotFoundException: com.regexlab.j2e.Jar2ExeClassLoader
           at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1469)
           at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1436)
Caused by: java.lang.ClassNotFoundException: com.regexlab.j2e.Jar2ExeClassLoader
           at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:348)
           at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2209)
           at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2195)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1456)
           at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1436)

I have  "/checksum:false" set already BTW.

Is there a way round this ?  I'm sensing there is some overlap in how Jar2Exe and codesign define the executable header info.

Thanks

 

 

 

 

Pages

Add new comment