There are some tools that will create exe-wrappers but they effectively just pack an entire JVM in with the classfiles.
Create an executable Jar instead, that can then be run on any computer that has a JVM installed by either double clicking on it (if the machine is so configured) or by using the java -jar command.
Create an executable Jar instead, that can then be run on any computer that has a JVM installed by either double clicking on it
Ok, so how do u do this in netbeans? I got to here but what do i do. My program creates a window with hello world in it. I can't get it to work. This is i got so far
Don't know how to do it from Netbeans. Should be mentioned in the documentation somewhere if it's possible.
If not check the JDK documentation for the jar command which tells you how to do it by hand (which you should learn to do anyway, you won't always have netbeans available).
I still cannot do thuis. I follow the instructions but I create a java.content file. not a jar executealbe file? Why is this so hard. Surely someone has netbeans and has created a jar file.
:cry:
I'm trying to keep this as simple as poss... using sams teach meself java 2 in 24 minutes.
import javax.swing.*;
public class SalutonFrame extends JFrame {
public SalutonFrame()
{
super ("Salut la monde");
setSize(350,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args)
{
SalutonFrame sal = new SalutonFrame();
}
}
I have create a folder wit two files. one with SalutonFrame.java and one with the class properties.
How do i manifest, is tat the word, this folder and create a jar executalbe inNETBEANS
I use netbeans too. When I am writing files, I just copy the code onto notepad and then put it on my zip drive, then when I get to the computer that I am going to use I just open up the notepad and copy the code then copy it back into netbeans. I guess it's a little complicated, but it works.
Hey thanks Richard. U seem 2 no what you are on about. If you don't mind explaining to me from the start how to use java from the command line. I've never used it b4.
I guess you could say I'm:-
Originally quoted by jwenting
"...Another victim of the IDE. Learns the tool, not the language, and gets stuck when there's no nice shiny "run" button for something."
So yes,I don't know how to change the directory or how to compile and run in the command line either. So you'll have to go through that with me if you don't mind. I appreciate all the help.
To jwenting...
I prob sound stupid but we all have to start somewhere don't we? And ur right about the pitfalls associated with fancy IDEs.
Netbeans uses the Apache Ant build tool to do it's compilation. The Ant build.xml file Netbeans uses should create a jar in a directory called 'dist' under the project folder.
As you know the pitfalls of using an IDE I would really recommend learning Ant. OK so it is not going right down to the command line (which is preferable) but it is a step in the right direction and will free you from the Netbeans IDE.
As I was editing an Ant build.xml file today at work it occurred to me that although it seems easy enough, it might in fact be more difficult for a beginner to get to grips with Ant then the standard Java toolset (javac, java, jar etc ...). To that end, Iamthwee, please see below a link to the Java tools documentation.
Yes, ANT is rather complicated. The authors have by now realised that using an XML based buildfile was probably not a good idea :) but of course it's far too late to change it.
The commandline tools are easy to use if you take a few minutes to RTFM.