How to convert a Java program into a Windows executable ?
#1
Thread Starter
How to convert a Java program into a Windows executable ?
I've made a Java program (a series of .java files) and I'm wondering how to convert that into a Windows-based executable. This will be used on our clients' computers and this whole process needs to be as painless as possible - the JRE/JDK would obviously have to be somehow packaged into the executable since I can't ask a client to go to Sun's site and dl the whole package since it would be too much work. How would I go about doing this? Thanks.
#3
Registered User
I'd advise compiling all your files and putting them in a jar (Main class file should be specified using Main-class: in the manifest), and then downloading JRE. Put everything in a directory, and write a batch (.bat or .cmd) file to execute your jar. Zip the whole thing up and send it to your client.
Or you can download Microsoft's JDK, which allows you to compile classes into self contained .exes. If you go the M$ route however, you'll be limited to java 1 features (i.e., J2SE features won't be supported).
Or you can download Microsoft's JDK, which allows you to compile classes into self contained .exes. If you go the M$ route however, you'll be limited to java 1 features (i.e., J2SE features won't be supported).
#6
nexus,
You have no idea what he has developed. How do you know the other "respectable" alternatives didn't fit his needs? And why is Java not respectable? You know, since you are not a developer and all.
If you want to go a longer route, you could develop a C++ app that makes JNI calls to your Java code. There is a wrapper to JNI called Jace that is helpful in using JNI.
That's the hard way though, but it would look exactly like a Windows exe. Have the users add the jar to the classpath (or do this during the Install, if you have one), and things should go pretty smoothly. And if you don't know JNI, it would be a good exercise.
ERIK
You have no idea what he has developed. How do you know the other "respectable" alternatives didn't fit his needs? And why is Java not respectable? You know, since you are not a developer and all.
If you want to go a longer route, you could develop a C++ app that makes JNI calls to your Java code. There is a wrapper to JNI called Jace that is helpful in using JNI.
That's the hard way though, but it would look exactly like a Windows exe. Have the users add the jar to the classpath (or do this during the Install, if you have one), and things should go pretty smoothly. And if you don't know JNI, it would be a good exercise.
ERIK
Trending Topics
#8
wow, I was wandering the same thing a week ago. Just wanna stay on this thread to see where it goes.
I've never even knew of JNI. You'd think all those classes that I took in Java, they'd tell you that JNI existed for that one class you actually had to code in C++.
I've never even knew of JNI. You'd think all those classes that I took in Java, they'd tell you that JNI existed for that one class you actually had to code in C++.
#9
Thread Starter
I'll look into it but I was hoping my JBuilder 6.0 development environment editor would include a feature where it could turn a package of Java classes into a "runnable" (executable-like) program.