October 27th, 2005, 11:37 PM
Since I have gotten very effective and concise answers here at AO, I have decided to post the following:
I am new to Java. I was wondering how do you create executable files with the java compiler? (As with C or VB you use "make"). I want to write a small app compile it with javac in Mac OS X and I want to create an executable file to be used in Mac, Win or anything else.
Any help will be appreciated.
Thanks in advance,
October 28th, 2005, 06:28 AM
You seem to want to do what java was made for, running programs on many different platforms, but you want to do it in the wrong way.
If you compile with javac, simply use the .class file on any OS with java installed and run your program with:
You seem to be wanting to make it into an executable, like a .exe in windows. As far as I know there is no way to make anything an executable for all systems like you seem to want. Different systems use different executable formats. Besides, I don't think you can make a native executable with the standard java sdk. I'm pretty sure you need an external app, perhaps that costs money. So as I have already said, stick with java, and use java to run your programs on all platforms with the runtime installed.
October 28th, 2005, 01:23 PM
You say you are new to Java so I was wondering if you go here:
Java Forums - Developer Forums I find the forums very useful and you may find your answer quicker on there.
On their main page Java Technology halfway down on the left is a whole learning section which includes tutorials. Whilst I was not able to answer your question I hope this helps.
October 28th, 2005, 05:18 PM
Thanks for your feedback
How about turning my java program into an applet therefore it can be run whithin html?
October 28th, 2005, 08:51 PM
The following link should be helpful
I also recommend downloading and using JCreator instead of javac for compiling, I would be lost without it. Screenshot attached.
November 19th, 2005, 02:53 PM
Executable Jar Files
On Microsoft Windows systems, the Java 2 Runtime Environment's installation program will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with javaw -jar. Dependent extensions bundled with the application will also be loaded automatically. This feature makes the end-user runtime environment easier to use on Microsoft Windows systems.
November 22nd, 2005, 09:34 AM
Click here for some good news:
JSmooth creates standard Windows executable files (.exe) that smartly launch java applications. It makes java deployment much smoother and user-friendly, as it is able to find and run Java VMs by itself, or help the user get one if none are available.
Janel is a Java native executable and launcher for Windows. Launch your Java application just like other Windows executables. Choose console or non-console application, the location of the JVM, and other properties. The process name is same as .exe name
Applet 2 Application enables conversion of an applet into a normal Java application/Windows executable.For this application, the target user is an applet developer. Once he has completed the development of the applet, he can use this application to create an executable file.
Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds