0

I'm using Mysql database and neatbeans IDE conncting by mysql-connector-java-5.1.21 jdbc , and I want to convert My program in my laptop to .exe file to be instaled in anthor PC's ....... help please ?

5
  • 1
    possible duplicate of How can I convert my Java program to an .exe file? Commented Jul 5, 2012 at 23:07
  • "to be instaled in anthor PC's" Deploy the lot using Java Web Start & it will even work on those desktop computers that don't run Windows. Commented Jul 5, 2012 at 23:23
  • @AndrewThompson Please don't spam the same comment on every answer AND the question as well. Commented Jul 5, 2012 at 23:43
  • @Hugo Same technology, different comment. :) Commented Jul 6, 2012 at 8:05
  • Your question has created some confusion. Do you specifically want an EXE? If so: a) Why? What is the advantage of it? b) Why start coding the app. in Java? There are easier paths to getting a .exe. Commented Jul 7, 2012 at 0:40

2 Answers 2

2

You can't do that, you'll need to drag over mysql and the jre along with those java classes. The best you can achieve is some launcher that contains everything inside of it.

If you want this to be a single, portable binary, your best shot is to use some embeded SQLDB, like HSQLDB.

Sign up to request clarification or add additional context in comments.

7 Comments

"You can't do that, you'll need to drag over mysql and the jre along with those java classes." I'm weary just reading about it. Go for the 'one click' solution using JWS. More hassle for the developer, but a breeze for the end user.
He specifically said he wanted an exe file (a windows binary), JWS is far from that, in that is not only requires a JRE pre-installed, but also the Java Plugin for the user's browser. I also think you can't install/run mysql through JWS.
"I want to convert My program in my laptop to .. to be instaled in anthor PC's" Take out the 2 words in the middle, which are often poorly chosen, and it points to JWS. "I also think you can't install/run mysql through JWS." You think wrong, JWS provides the extension installer service.
Sure, if you alter the op's question, other answer will apply, I answered the one he actually asked, not a variation of it.
That is a valid approach. I like to think outside the box. ;)
|
0

The only way I know of doing that is to use Launch4j .

4 Comments

@AndrewThompson Please don't spam the same comment on every answer AND the question as well.
@AndrewThompson - I don't think JWS is related to answering this question. In no way is JWS related to creating a .exe file.
I try with Launch 4j and it fail to connect with mysql DB the output error is com.mysql.jdbc.Driver any idea???
Yes, JDBC drivers are a unique beast and cannot be loaded using the typical classforname method when the app is loaded on another 'custom' classloader like Launch4j, Ant, YAJSW, etc. I believe there is a way to get it working but the JDBC .jar needs to be pre-loaded by the custom classloader. Using jconsole or JVisualVM to inspect the classloader (runtime classpath) may give you a better idea of what the problem is. Another possibility might be OSGI, similar to how SquirrelSQL and Eclipse would dynamically load the JDBC .jar .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.