[java] How do i create a standalone java exe?

Started by
12 comments, last by trevaaar 19 years, 2 months ago
I managed to create JAVA exe with a program called 'Java Launcher'. The exe produced works fine on my computer and other computer science people's computer. When I run it on a computer virgin of any JAVA stuffs, it complains 'JDK not installed'. Any help please?
Advertisement
The JDK obviously needs to be installed on the target computers. No (reasonable) way around that...
Java is a language that runs on a virtual machine. With the virtual machine to interpret it, the computer looks at the code and goes, "What the crap is this?"
What it really requires is the Java Runtime Environment (JRE), not the Java Software Development Kit (SDK). You can however use the GCC Java Compiler, which you can find links to here. I personally haven't used it, but it could be what you're looking for.
Is there an easy way to link the class files, and create a 'shortcut' the the JVM stuff? I've never actually ran any of my programs outside my IDE, or as an applet.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Link? About what are you talking?

But if you really want something then

main: yourClassFileHere
dont forget enter at end of the line
Quote:Original post by Talroth
Is there an easy way to link the class files, and create a 'shortcut' the the JVM stuff? I've never actually ran any of my programs outside my IDE, or as an applet.


Not entirely sure what you mean, but I think that executable Jar files might be what you're looking for...

BTW: Am I the only one who doesn't like the idea of native executable wrappers for Java? It kinda defeats the purpose of its cross-platform capabilities, doesn't it?
www.aidanwalsh(.net)(.info)
Quote:Original post by doodle_sketch
BTW: Am I the only one who doesn't like the idea of native executable wrappers for Java? It kinda defeats the purpose of its cross-platform capabilities, doesn't it?
I must admit I'm not a fan of wrappers either, so no, you're not the only one. :) I always thought executable JAR files did a fine job. Of course, if you want to have a custom icon associated with your program I think you might have to settle for a wrapper.
I use wrappers when sending my java programs to people who need to see the 'ExpensiveProgram.exe'. By doing this I can save the hassel of having to retell every person who uses the program that it needs the JVM to run... They always look at you like they don't believe you. "Isn't it just a program?" they don't get that not all programs are exe files... On macs it is no problem because I can create app files, and then usually for people who run Linux or Solaris they know what the heck a dang JAR file is.

I find that wrappers help people to just RUN the program without having to call me up.
BRING BACK THE BLACK (or at least something darker)
Yes! That's the main benefit of it I would think. No need to have the JRE installed. The cost is that you'd have to "recompile" for every platform you want to run on. Any other downsides to it? It sounds interesting, will have to try it sometime.

This topic is closed to new replies.

Advertisement