JarWrapper FAQ

 

  1. What is JarWrapper?

JarWrapper is a utility which can be used to convert a Java Application to a Windows executable file. JarWrapper creates an executable Jar file from the Java class files and then wraps it in a Windows executable. Hence the name “JarWrapper”. J

  1. Does it cost money?

It’s a freeware application. You can use it to convert your java class files into a windows application completely free of cost. However, the source code is not made available to the public and hence it’s not an open source application as of now.

 

  1. How do I use it?

You need to have JDK 1.2 or higher installed on your machine in order to convert your class files into an executable. However, if you already have prepared the executable jar file previously, then you don’t need the JDK to convert it to Windows executable.

Just click on JarWrapper.exe and its wizard like interface will make you flow through the entire process.

 

  1. Does it support Application Command Line parameters?

Yes, it supports Application Command Line parameters. If your Java program expects any command line parameters, then the converted windows executable also will expect command line parameters.

 

  1. Does it support JVM Parameters?

As of this version, JarWrapper doesn’t support JVM parameters. But this is planned to be incorporated in the next version.

 

  1. Can I specify CLASSPATH when I create the executable jar file?

No, the application doesn’t support CLASSPATH entries while preparing the executable jar file. You need to extract all the dependant third party zip/jar files into a common folder along with your application class files, maintaining the package hierarchy. Then you can use this application to create the Jar file and subsequent windows exe file. If you miss to extract/package any of the dependant jar/zip files, then even though your application will be created, it wouldn’t execute. JarWrapper doesn’t check for the validity of the generated jar file/exe file.

 

  1. Does it create true 32 bit Windows executable?

No, JarWrapper doesn’t create a true 32bit windows executable. It only wraps the executable jar file in a Windows exe file. It still requires Java 2 environment to run.

 

  1. I have an applet. Can I convert it to an executable file?

You can not use the JarWrapper to convert an applet to Windows executable directly. However, you can use Applet2App to convert an applet to an executable jar file. And then use the JarWrapper to convert it into a Windows executable. So it’s a two-step process.


 

  1. Why should I wrap my Jar file in a Windows executable file?

 

Some reasons, I can think of:

·                     Your end user need not know you have created the application java.

·                                                   Since the end user doesn’t know it’s a Java application, he won’t even try to demangle the jar files, so common security hassles with java.

·                     You can use a resource editor like resource hacker to change the application icon that appears in the windows explorer bar. This will look better than the notepad style generic icon associated with executable jar files.

 

  1. I have created the exe file. When I click on it, it says “Main Class not found”. What’s wrong?

·                                                   May be to start with, your Jar file is not a valid executable jar file. JarWrapper doesn’t check for the validity of the jar file. It simply wraps the file given to it as an executable. May be we can remove this limitation in future version.

·                     If you are using JRE 1.1, then this error might come up as JRE1.1 doesn’t support the concept of executable jar files.

·                     May be you trying to convert an applet to application directly. First use Applet2App to create the executable jar file and then use JarWrapper to create the application.

  1. I have created the exe file. When I click on it, nothing happens. What’s wrong?

·                                                   May be you have not wrapped a valid executable jar file

·                                                   While creating a GUI application, you have specified the application as Console application. Then this won’t work. The reverse case is also true. If you have a console application and you specify it as a Swing application. Then also this problem will occur.

  1. How do I change the application icon which is displayed in the explorer bar?

You can use any of the freely available resource editors in the market. I will personally recommend a tool called resource hacker to do this.

 

  1. The application icon (which is displayed in the explorer bar) and the application icon (which is displayed on the left side of title bar when the application is running) are different. How do I rectify it?

This is because while setting the application icon in your java code, you must have used a code snippet similar to the following code.

            setIconImage(Imagefile);

 

                        Use an icon editor/ picture converter to create a 32x32 pixel ICO file from the Imagefile. Then use resource hacker to change the application icon when the final executable is ready.

 

  1. How do I distribute my resource files apart from the Windows executable file?

This actually depends upon the way you have used the resources in your code. If you have coded in such a way that your resources can be found from a Jar file, then you don’t need to separately package the resources. They can be embedded inside the executable jar file and hence in the final Windows executable. Otherwise, you need to explicitly package the resources separately apart from the final Windows executable file.

 

  1. While building my application, I have used third party Libraries in the form of Jar Files/Class Files. How do I distribute them along with my Windows executable file?

Please refer to question no 6 for details.

 

  1. Can I use the windows executable as an NT Service?

The wrapper exe can not be directly used as an NT Service. However, there are so many free tools available on net which let you run an executable as a NT Service. May be you can try one of those executables.

 

 

 

 

          Back