Join us at IRC!
Society leans ever heavily on computers, if you have the power to take out computers you can take out society. - cubeman372
Thursday, May 17, 2012
Navigation
Members Online
Total Online: 27
Web Spiders: 17
Guests Online: 25
Members Online: 2

Registered Members: 70043
Newest Member: nixium
Latest Articles

JAVA .exe files



FLV Blaster - Download Music and Videos Faster

website security Too long have .jar been the way for java programmers. Now, a true .exe file for us. And here's how.



For those of us who learned JAVA in schools or on our own, there's always been the

major problem of: the .class file.

The nice folks at Sun gave us the .jar, but still, it requires the JRE and JVM (Java Runtime

Engine and Java Virtual Machine) on the computer where this .jar file will be run.

The solution to this is third party programs. Programs like: EXE4J and JEXECreator.

These are what is called a JIT(Just in time) compilers.

This tutorial will be fore JEXECreator since that is the one I have, tho I have heard the

EXE4J works just fine.

So...go off and download JEXECreator, its got a free demo that needs a serial...;)

Install, open...and lets go:
First, you need to start yourself a new project, name it whatever you desire.

Make sure that under the active project pulldown menu, that is the project.

okay, so select the "Output" tab. And fill in the 3 pieces of info this needs. The most

important is the GUI/Console radio button. For those of you wondering which, if your code

works like nmap or JTR and is only black and white "Command Prompt" style text, pick

console...otherwise, GUI is for you.

Now, "Java Settings." The "main class" should be just as it sounds...the class with your

"main method"...
public static void main(String args[])
... in it. JVM arguments asks for anything that is passed in via the console to the args[]. If

you have nothing there, set eliminate to true. Minimal Version asks for what JRE you

want. The current version out is 1.5. Some of us still use the old 1.4. What does this

change? Well, pretty much thats in the code you write. Newer versions have extra

features (more libraries, its somewhat dumbed down, no offense). The reason for this

implementation into your .exe is so that if the JRE is not on the computer, it will know

which version to go find.

Alright, now "classpath." This is where you put the code into the program. If you've got

yourself a nice little .jar file, add JAR into EXE, otherwise add the classpath and direct

that to the folder with your .class files. Only have the ones that pertain to this program in

that folder.

Don't bother with "Search Settings."

"Custom Resources" is where you add the fluff to this .exe. Title, Icon. The download URL

is for those people who don't have JRE. Unless your running your own version of JAVA

don't change the first URL. The second can be redirected to your site for help, service, or

FAQS.

The "Message Bundles" are for handling error and other messages. Don't really mess with

this unless you have reason. They are fine the way they are.

Now, click build. Then run. Check your output location. And ...your done.
Now this builds you a .exe file, which is nice, it still need to be packed with the .class

files tho. It will run on most computers, I think they need the same amount of java

installed as your inet needs. If you find differently pm me and I'll make an edit. I've found

that it works on on any computer.




Comments

kingofstrings411 on November 07 2006 - 18:57:02
thank you!!!! ive been wondering how to do this....
only_samurai on November 07 2006 - 20:20:31
heh, no problem. another upside of this is that it takes its speed up to like c++ because it doesnt have to be interpreted. so it makes java much more useful than it already was.
T-Metal-Risen on November 07 2006 - 21:29:01
much less useless* , jk.. relax, wanted to see how you'd react :p, but a nifty little article.
only_samurai on November 07 2006 - 21:59:29
haha....thanks mate. my grammer blows a big one. lol. thanks for the comment tho. enjoy the article
h4xguy on November 07 2006 - 22:41:52
I dun get it.....
only_samurai on November 07 2006 - 23:58:07
you "dun" get what? pm me if you want more explination
ynori7 on November 02 2007 - 21:15:37
I know i'm reading this like a yar late, but it was a very helpful article. although since i used a free version of JEXECreator it pops up an annoying little alert box before running the program. Any idea how to kill that without buying the program?
Maca on January 20 2008 - 00:46:48
Defeats the purpose of Java
only_samurai on February 27 2008 - 18:35:19
Yes, it does remove the portability of JAVA and removes the JVM (which does a nice job of coddling java code), but in the case that you want your app to be run-able on a box with no JRE, like a school box you cant install it on, this is useful
Post Comment

Sorry.

You must have completed the challenge Basic 1 and have 100 points or more, to be able to post.
Ratings
Rating is available to members only.

Please login or register to vote.

Awesome! 17% [1 Vote]
Very Good 17% [1 Vote]
Good 17% [1 Vote]
Average 17% [1 Vote]
Poor 33% [2 Votes]
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.