954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Want to make exe/jar of a java based project

I have done a stand alone project on Java Swing and MySql where the frontend is designed by Swing and backend is designed on MySQL

I wanna build an exe of the project by incorporating the MySql schema and tablespace into the archieved file(exe/jar)

Plz tell me whether is it possible?
If it is possible then tell me how can I do this .

arkaprava
Light Poster
34 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

you can create jar for your project

you have to make manifest file

Manifest-Version: 1.0
Specification-Title: Java Utility Classes
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: maninclassname


save it as manifest.mf keep this file in current project folder.

and go to project location then type in command prompt:

jar cmf manifest.mf anyname.jar *.*

press enter then you will get your jar file created.

vinod_javas
Practically a Posting Shark
871 posts since Feb 2007
Reputation Points: 119
Solved Threads: 7
 

If you want to create Exe means you have to go for third party tool.

vinod_javas
Practically a Posting Shark
871 posts since Feb 2007
Reputation Points: 119
Solved Threads: 7
 
If you want to create Exe means you have to go for third party tool.

Please Mention one third party tool

arkaprava
Light Poster
34 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

execJAVA currently am using this exe converter from jar file.

but its trial version only.

you can download this from www.JavaAPIs.com

anyway you have to convert your application in to jar format.

vinod_javas
Practically a Posting Shark
871 posts since Feb 2007
Reputation Points: 119
Solved Threads: 7
 

just Tried execJ but cannot include tablespace into the exe
The application is running from exe without any operation on database

arkaprava
Light Poster
34 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

nativeJ is an easy to use java-to-exe tool, but why would you want to make an exe of it,?

if you're intending to let other people use your program as well, I'd suggest you stick with the jar file.

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

nativeJ is an easy to use java-to-exe tool, but why would you want to make an exe of it,?

if you're intending to let other people use your program as well, I'd suggest you stick with the jar file.

Jar file is good for using the software , also batch file can also be created
by which we will run the jar file without trying into commandline
but the problem is what will be the databases and connectivity how can I import database schemas in the jar file which will be created .
and suppose I want to run/deploy the application in a machine where the mysql server is not present and also classpath is not present , so in that case database schema and tablespaces also should be packaged with jar file

How can I solve it out jar along with schema and connections

arkaprava
Light Poster
34 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Read this arcticle " Convert Java to EXE " and you may find some answers

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

If you are talking about DB server installation through your executable jar, I won't recommend it. See, DB installation requires user interaction, which shall not be easiest of things to achieve.

If you ask your application users to at least install DB server and have a default user, rest I think is achievable.

Without much thinking I can think of following strategy to get this done:
Have a properties file with DB credentials - username/password and table space related values which user wishes to create for new application installation. This properties file should also contain default username and password.
You can have a batch file which will call up a java code which shall in turn read from this properties file, login into DB, create tablespace and user in client's DB.
Next, you can have all DDL statements in a file, and same java code can execute this sql file to create your DB schema.
Once this is done have another batch file to execute the actual application code, which shall execute your application.

This is a two step process, but I guess would be safer and faster to do. For the second step you can think of creating an exe.

For your concern on not having classpath or for that matter even JRE, please go through following link:
http://forum.java.sun.com/thread.jspa?threadID=780494&messageID=4441193

After this classpath won't be that big problem I guess.

ksaxena
Light Poster
31 posts since Jul 2007
Reputation Points: 10
Solved Threads: 4
 

You might want to take a look at this for distributing your MySQL database:
http://dev.mysql.com/downloads/connector/mxj/5.0.html

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

anyone wanting to turn Java code into native Windows executables should be shot on sight.
It's useless.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

If you are talking about DB server installation through your executable jar, I won't recommend it. See, DB installation requires user interaction, which shall not be easiest of things to achieve.

If you ask your application users to at least install DB server and have a default user, rest I think is achievable.

Without much thinking I can think of following strategy to get this done:

  • Have a properties file with DB credentials - username/password and table space related values which user wishes to create for new application installation. This properties file should also contain default username and password.
  • You can have a batch file which will call up a java code which shall in turn read from this properties file, login into DB, create tablespace and user in client's DB.
  • Next, you can have all DDL statements in a file, and same java code can execute this sql file to create your DB schema.
  • Once this is done have another batch file to execute the actual application code, which shall execute your application.

This is a two step process, but I guess would be safer and faster to do. For the second step you can think of creating an exe.

For your concern on not having classpath or for that matter even JRE, please go through following link: http://forum.java.sun.com/thread.jspa?threadID=780494&messageID=4441193

After this classpath won't be that big problem I guess.

Nice suggestion bro I trying to do according you said

arkaprava
Light Poster
34 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You