3

Possible Duplicate:
How can I convert my java program to an .exe file ?

I wrote a program with Java and MySQL.

I built a .jar file from it and it works when its connector was with it.

Now I want to convert my project to a simple .exe, and used of install anywhere but to build .exe file from my project.

When I click on .exe file, it can't connect to database because its connector wasn't with it.

How can I build an .exe file from my project that doesn't have problems with connecting to MySQL?

Community
  • 1
  • 1
Mahdi_Nine
  • 14,205
  • 26
  • 82
  • 117

2 Answers2

0

Launch4J

JSmooth

Umesh K
  • 13,436
  • 25
  • 87
  • 129
0

You shouldn't.

  • Exe-files are bound to the windows plattform. One big advantage of Java, platform independence, is lost, if you force your customers to use windows.
  • Some tools pack the JRE into the package. It gets fat, and the customer ends with 20 JREs for 20 executables, where one original JRE would be enough.
  • Either the executables don't update themselves - then the customer is depending on you providing him with updates for the JRE, updates which he might have already get for his independent JRE installation. Or for 20 exes, he get's 20 updates, instead of one.
  • You have to rebundle your application with every JRE you support. If you have app version 1.0, 1.1 and 1.2, and JRE has versions 6.01, 6.02 and 6.03, you have 9 distributions, and maybe 9 support cases. For 10x10 updates you may have 100 updates.
  • The hot-spot-compiler can be much better, performance wise, than a statically compiled program.
user unknown
  • 35,537
  • 11
  • 75
  • 121
  • Sometimes, the target OS is stated as part of a project requirement specification where it may include project client's expectations on the behavior of their final Java application in the target OS. With this kind of requirement, it sets the limit on the portability of Java platform. – eee Apr 21 '11 at 02:20
  • a) An executable jar runs fine on Windows without creating an exe-file. b) Still, you have tons of exes to update, instead of one single JVM. c) Performance gains from the hotspot compiler might be given away. – user unknown Apr 21 '11 at 02:29
  • Yes, I know...But, there is a special case where a user requirement may need you to properly do it for example: in Windows 7, your java app that runs through a Java launcher must properly pin to the Windows 7 taskbar with a proper grouping and with the correct app icon. When the user presses the shortcut to your Java app that has been pinned to the taskbar, it should properly group it without creating another icon on the taskbar...This can only be achieved by registering AppUserModelID to your Java app EXE process and AppUserModelID-embedded shortcut. Crazy right? – eee Apr 21 '11 at 03:01