Hi, I'm working on a personal project, developing a program that would help me. I just thought it would be nice if I could turn it into a click-and-run executable application rather than the .bat file I've put together.

Anyone have any ideas?

Thanks,
Lakepoint

Recommended Answers

All 10 Replies

you have to convert your application in to executable jar file..

for that you have to follow some procedure

you have to create manifest file

in that manifest file you have to mention your main class name like below.

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

and save it as manifest.mf and keep this file in project location.

and then you have to run the following command in DOS prompt

(go to projetlocation via command prompt)
jar cmf manifest.mf filename.jar *.*

then you will get your executable jar file

As jar file can be easily decompiled. Try using a third party tool on your jar to build an exe. This way your source code will be secured.

Its just a suggestion. :)

commented: I have never heard something so f**king retarded in all my little life? +11

You may want to read this article Convert Java to EXE has also links to packages mentioned in the article, in here are some comments in Javalobby on author article (interesting reading too) and some useful tips on creating JAr files

www.download.com has plenty of tools to do the job. All you have to do is spend 5 mins to do a search and try some out to find one that suits your needs.

As jar file can be easily decompiled. Try using a third party tool on your jar to build an exe. This way your source code will be secured.

Its just a suggestion. :)

and utter nonsense.
ANYTHING can be decompiled, and tools that turn jar files into executables in fact don't do that.
All they do is add a thin stub to the jar that launches a JVM and passes it that jarfile.
The jarfile is quite easy to extract from that.

"security" and "preventing decompilation" are the worst reasons to want to turn a jarfile into an exe, and at the same time the best.
In other words, there are no valid reasons whatsoever to want to do that, and people marketing such tools are effectively marketing snake oil.

> All they do is add a thin stub to the jar that launches a JVM and passes it that jarfile.
That is just one way of doing it. There are different ways of making an executable of which one is a true way of converting java file to an executable known an Ahead of Time Compilation. This is an interesting read.

You can check some pro and cons on native compilers here, secondly what I understand is that "you may lose certain features of the Java platform if you compile to native code"

yes, you will loose a lot.
Not in the least you loose the platform independent nature of the classfile format.
You almost certainly also loose a lot of things to do with reflection and introspection, which are also lost when employing obfuscation.

And you loose an excellent opportunity to learn about the platform.

Thanks everyone for replying. I was a little busy in the adventure called real life but now that things are slowing down, I'm going to try all your suggestions and let you guys. Thanks again

yes, you will loose a lot.
Not in the least you loose the platform independent nature of the classfile format.
You almost certainly also loose a lot of things to do with reflection and introspection, which are also lost when employing obfuscation.

And you loose an excellent opportunity to learn about the platform.

hopefully ull also "loose" the inability to spell

commented: Not off to a great start here. And your use of "ull" is rather ironic in context. -2
commented: nice one, kiddo. Very mature. -4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.