Monday, March 2, 2009

Convert JAR files to EXE

Hello Everyone,


The most worried things in java world is how to save your code from decoding.
  
As you all know that there are certain tools which decode or convert your .class file code to .java files.

So how can you save your code.Solution is make a exe or Executable for windows user.
 
If you want for window OS then here i am listing all the tool for converting jar files to exe Executable.

These tools are also used for deployment purpose or setup maker.
I used many of them and they are superb.
  

1. Excelsior JET

2. JSmooth
6. IzPack

7. JExecreater

8. ExeJ

9. Executer

10. Jar2Exe

11. Advace Installer

12. JExePack

13. Xenoage

14. NativeJ

 15. JNC


34 comments:

  1. So, you are expierciend with Java?
    Could you help me out with something?
    Im trying to start a run.bat and then it says:

    Exception in thread "main" java.lang.NoClassDefFoundError: client
    Caused by: java.lang.ClassNotFoundException: client
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: client. Program will exit.
    Druk op een toets om door te gaan..

    Could you help me out?

    ReplyDelete
  2. Thanks.

    Of course i will help you.

    I think you using any addition package
    which contain Client class.

    And error occured because either you are not
    added in classpath or your jar file is not in
    jre\lib\ext.

    Just do following.
    1. Put your jar file inside jre\lib\ext.
    or
    While compile and run just add classpath

    Javac -cp "path_of_jar_file.jar"; yourfile.java

    Please can you tell me in detail.
    And put your mail id or something where i can
    post.

    Hope it will help you

    ReplyDelete
  3. thanks, just what i need

    ReplyDelete
  4. is there any way to convert a *.jar file to a *.exe file which can be run in windows which doesnt have JDK installed....???

    ReplyDelete
  5. Hello Koushik,

    Without SDK you cannot run your java application.
    But if you just copy and paste your all jre file and by setting classpath you can run your application.

    So that is what work without installation.

    Above there are number of tools available which can make a setup file for java application.

    So you can include a whole jre on that setup.
    It can distribute with your application.
    hope it help you.

    ReplyDelete
  6. but which one among them allows us to include a whole jre on that set up....???

    ReplyDelete
  7. Koushik,

    Try Excelsior JET (1).
    Or if it is found difficult(Because it have many options) then do one thing.

    1. Create a jar to exe with the help of any of them.
    2. While creating exe file if they ask for jre classpath then add "\jre" it means you have to put your jre folder aside of your exe file.

    3.With the help of any setup builder(Used for windows application i.e. instant shield etc) you can create a setup which include your jre and exe file.

    4.When you extract that setup then your exe search for classpath and found jre easily.

    hope it help you.

    ReplyDelete
  8. i am trying ....
    nd will thank u wen it will b done...
    ok...???

    ReplyDelete
  9. ohooooooooooo.......thanx Prashant...it has been done...!!!
    Finally i have made the installer file...

    so d next step...
    here i also need your help...

    i think , i m not irritating you...
    am i...???

    so here is the next 2 questions...

    1.
    i have made a front end software using java.nd i have some database files....now the problem is, if i would want to distribute my software to anyone...then i also need to go to their home to connect the databases with the program, via odbc tools in tha control panel.( control panel-> administrative tools -> Data sources(odbc))
    like that....

    is there ne way..other than that via which i dont need to rush their home to set the DSN...???

    if their is...then please help me....!!!

    i need your help...

    thanx in advance...!!!

    2.
    i have made a menu in my software ""ABOUT"" like all the softwares have.
    but the problem is in the dialog box of about ...i want to place a button ""OPEN READ ME """...d by clicking on that a read me.txt file will open,which saved somewhere on my HDD.

    i think i am clear to my problems...!!!

    please help me out....


    thanx in advance..!!!

    ReplyDelete
  10. nd 1 more thing...
    i am using microsoft access as my databese...!!!

    ReplyDelete
  11. Congrats,

    So finally you have done.

    You never ever irritating me.
    You just ask question if i am able to do so i will Definitely help you.

    Tell me something..
    1. By which tool you are creating Exe file?
    2. For your question 2.Which dialog you are calling when clicking About menu.
    i think u r using JDialog,thats why you cannot.
    Use JWindow and add what ever you want.
    Add a button and on click event open your txt file.

    But my suggestion to you why you are giving button and calling txt file.Are you see any software which calling txt file from about button.
    You should add all the content of txt file into about window itself by adding simply a Jlabel.

    Right now i am unable to solve your first problem.
    Because i am basically from imaging.
    But i will see that.I was also facing the same problem while engineering.

    But still you don't need to go anybody's home.

    I will be searching ..ok
    bye

    ReplyDelete
  12. Hi Koushik,

    See below link.

    Click linkIt is having two java file.
    And it is working superb.
    Just go through it,I tried and its just like what you want.
    Download both the source files

    Just make a mdb file.After compile pass file name and query while running code.

    Amazing if your mdb file path is correct then it print all your data.

    But i can't say it will work or not if your client is not having MS office or not having a particular version,you have to try urself.

    Inform me if you have done.
    you can also mail me on prashant144@gmail.com
    for other questions.
    Thanks

    ReplyDelete
  13. Another jar to exe program is the Jar Compiler plugin for the Eclipse IDE. For both Windows and UNIX.
    http://www.tabbyinstall.com/jarc/JarCompiler.html

    ReplyDelete
  14. i need register key for JEXECreator help me please..send to my email ericplanetku@yahoo.co.id!thx before

    ReplyDelete
  15. sorry friend but i don't have that.
    Its licence version and i am not purchased that.
    thanks

    ReplyDelete
  16. Prashant Chandrakar,

    Its very easy. Use Launch4J to wrap your JAr into an EXE and select bundle JRE.

    Then use AdvncedInstaller to install as a windows exe and distribute the jre in the install package.

    Bothe free, both excelent tools

    ReplyDelete
  17. Hi Prashant,

    Thanks for this great article.
    I want to create an .exe of my executable jar.
    I am facing problem while I was creating jar file. My main jar(a.jar) have dependencies on x.jar, y.jar. I don't know how to package all these three jars in a single executable jar. Can u help me on this. :)

    ReplyDelete
  18. Hi Ritesh,

    Which tools you want to use?
    You can add all jar file path in your manifest file.
    Or while creating exe these tool will ask for your dependencies jar.
    Thanks

    ReplyDelete
  19. Thanks for yr quick response :)
    As m a beginner to this kind of stuff.
    Can u suggest me one of the above listed tool with minimal configurations.
    BTW, i m making up my mind to go with Launch4j.
    Looking forward to listen from ur side....
    Cheers :)

    ReplyDelete
  20. Hi Prashant,

    Thank you for the article, so helpful!

    I choose launch4j for convert my .jar file to .exe. It uses another jar and .dll files. I know how to add the jar to my main jar, but don't how to add this .dll file. Can you please give me some help? I use Netbean to develop my application. Thank you very much!!

    ReplyDelete
  21. What a post...........

    The ultimate one......

    Thanks a lot

    ReplyDelete
  22. thx for all these information but all these solution (.exe) is not valid to connect to database (MySQL)...
    can you help me or give me another solution to make .exe with database (MySQL)???
    and thx
    my mail is : hajjaji.mefteh@yahoo.fr

    ReplyDelete
  23. hi

    could you help me?
    I am trying to convert my jar file to exe.

    I have a jar file for mobile application. but I don't know how to make it as exe file. please send me the tool jar2exe. I am not able to download this tool from above mentioned site. It asks some details and trial pay amount $29.00. so please send me if you have.

    email: g.naresh968@gmail.com

    ReplyDelete
  24. hi prashanth,

    tell me plz.
    What jre used in mobiles to run .jar or .exe files. is that differ with actual jre?

    ReplyDelete
  25. Hi Naresh,

    will send you soon.

    What about other tools which are mentioned here.
    Are you tried others.

    And i think 'jar' file is better solution for Java based mobiles..

    thanks

    ReplyDelete
    Replies
    1. Hi prashant please post here many people are looking for same solution

      Delete
  26. hi commenton,

    I think it should differ from actual jre because of its size.
    If you install current jre in windows system it will take around 130MB.

    Just try with the actual one.
    Will get back to you after some R&D.

    Keep your R&D.

    ReplyDelete
  27. Thanks for the article
    i found many of the tools for converting jar to exe.
    Just see the links.
    Its very good and helpful.

    Convert Jar To EXE, Executable File

    ReplyDelete
  28. hi.i have wrote a simple java application in eclipse that selects a video file and run the video in panel.i need this application to be converted as software run on any os..

    that is jdk and jvm has to be packed with the source and it should run on a single click.
    i have already tried as converting it to .jar.But it is running in jdk installed machine alone.tell me better solution for this soon.......

    ReplyDelete
  29. i found that most of the tools is for tomcat, is that any of them is applicable to oc4j ? hope to get ur reply, genyou90@yahoo.com

    ReplyDelete
  30. You can see lot of other tools, for converting jar to exe on below article

    http://www.javatips.net/blog/2011/09/convert-java-jar-file-to-exe

    ReplyDelete
  31. Can anyone please suggest tools to convert .jar to .exe in ubuntu??

    ReplyDelete
  32. hiii,
    I converted .jar file to .exe comfortaby and thank you for guiding me :)
    But when I am running in any other system then it is showing Java Run Time Error....
    please help

    ReplyDelete
  33. Hi i have one issue i.e, i have created a Common JFrame and on button click i'm loading a new Dialog into that Common JFrame.The problem is it works fine when i run the project,but pasting the project jar file some other machine the dialog is not executing.Using JOptionPane.showMessage() i checked the control is executing till the object creation for that JDialog,but its not executing obj.show().Please help me out. Thanks in advance

    ReplyDelete