Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Java in exe form?

Started by Lord Hen Jan 31, 2004 at 9:27 PM 10 replies 1.7k views
Original Post
Lord Hen
Lord Hen
Im learning Java, and I know how to compile a program into a .jar, but a friend told me he thought it was possible to make a java program into an exe, but he didnt know how... Anyone know about this? Thanks, Lord Hen "I am free of all prejudices. I hate everyone equally." - W. C. Fields [edited by - Lord Hen on December 2, 2008 2:32:49 AM]
JohanOfverstedt
JohanOfverstedt
You could write a c++ program that simply loads the jar.

DISCLAIMER: If any of the above statements are incorrect, feel free to deliver me a good hard slap!

My game: Swift blocks
DISCLAIMER: If any of the above statements are incorrect, feel free to deliver me a good hard slap!My games: DracMan | Swift blocks
CaptainJester
CaptainJester
You can get a program that will do it for you. One is called Jet. It is a little expensive, but it works. I have seen some free ones, but I have never been able to get them to work.



First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
justo
justo
you can also make executable jar files, as long as the user has a JRE setup. but do you want to make it an exe for convenience or to have it natively compiled?

if its the later youre going to run into some troubles, most of those efforts (free versions at least), AFAIK, were abandoned a while back. check out jet...but i think youll find its not really worth it...the whole point is cross platform compatibility. double click running is pretty trivial to implement, and you can even have some premade files onhand to bundle with whatever project you want to publish.
Lord Hen
Lord Hen
I was just wondering about this...
I''m personally fine with running a java program from command line or whatever, but a friend of mine is too lazy(stupid?) to do it, and he just wants an exe he can click (sounds like he doesnt deserve to run my java programs, huh?).

So, what do large-scale java apps do? I figure largly distributed apps would be user-friendly, so they would have a way to run the program in a way thats familiar to the users, like an executable. Do they expect them to figure it out, or make a c++ program that starts it?

Thanks,
Lord Hen

"I am free of all prejudices. I hate everyone equally." - W. C. Fields
OrangyTang
OrangyTang
quote:
Original post by Lord Hen
I''m personally fine with running a java program from command line or whatever, but a friend of mine is too lazy(stupid?) to do it, and he just wants an exe he can click (sounds like he doesnt deserve to run my java programs, huh?).

The pure-java way is an executable .jar file. This is basically a single file containing all your compiled classes, and a small manifest file labling which is the main class. Compile once, deploy everywhere - no rebuilding needed.

Or you can look into Webstart, which lets you launch apps with the click of a single link (like those two in my sig). Needs a ''net connection though, but you don;t have to keep putting files on disk to move them around and install.


[S-Type] [V-Script]
djsteffey
djsteffey
the way to make an native code compiled java program is to rewrite it in c++


"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA
eedok
eedok
quote:
Original post by Lord Hen
I was just wondering about this...
I''m personally fine with running a java program from command line or whatever, but a friend of mine is too lazy(stupid?) to do it, and he just wants an exe he can click (sounds like he doesnt deserve to run my java programs, huh?).

So, what do large-scale java apps do? I figure largly distributed apps would be user-friendly, so they would have a way to run the program in a way thats familiar to the users, like an executable. Do they expect them to figure it out, or make a c++ program that starts it?

Thanks,
Lord Hen

"I am free of all prejudices. I hate everyone equally." - W. C. Fields

in your windows distro of your program, use exe4j as the launcher, and for linux one just make a .sh file(as those don''t bring up the console).. Not sure what to do for macs or SPARC''s though..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.