tags:

views:

89

answers:

4

Hello, I need to make an answering questions game and I chose to make it using netbeans. I wonder if I can create an executable so that somebody could "play" the game even if he does not have installed netbeans! Any ideas please?

A: 

When you build it, a JAR (Java archive) will be created (look in your dist/ directory or your project properties). If you've set up your project correctly, launching that JAR will start your application. See http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html

erjiang
What if he is not using Java... :). Most probably he is using Java, but may be not ...
Incognito
@Incognito, the question is tagged `java`.
Lord Torgamus
@Lord Because someone else tagged it `java`
M28
@mazin k. It was re-tagged.
Incognito
@M28 yeah, I did check the timestamp, but I figured by the time I arrived there was enough of a rollback window.
Lord Torgamus
+1  A: 

Developed program has nothing to do with IDE. It doesn't need IDE to be executed...

Incognito
+1  A: 

There is a misconception: Netbeans is not a runtime platform. Netbeans is just a tool to build Java applications. You can perfectly create the same Java application with just notepad.exe and the JDK, you only need to have a bit more knowledge and experience to do it rapidly enough.

To run a Java application, all the enduser needs to have installed is a JRE. To create a runnable Java application, all you need to do is to export the Netbeans project as an executable JAR file.

BalusC
+3  A: 

In NetBeans set your application as the active project and press F11, which builds the project. This means that your application will be packaged into an executable jar file that you friend can click to run your application. Once you have clicked F11 you can locate the executable jar file at e.g. ../Documents/NetBeansProjects/ProjectName/Dist

Leffy
Actually not! The .jar file seems to be...old!!! I create some new classes (JFrame Forms) and when I buid and run the application, all seem to work fine, but when I execute the programm by clicking the .jar file, the new class is not there! It is something that I do wrong, that's for sure!
Geo Gkolfi
Have you tried to open the jar file with a program such as winrar or 7-zip to see if the classes are there? It's an easy way to make sure if they classes are actually there.
Leffy
Actually some of them are not! I deleted the .jar file...shouldn't it be recreated when running the application? It does not! :-)
Geo Gkolfi
You could try to clean and build your project and see if it helps. Press shift + F11 to do this. Make sure you have your project set as active when doing this :-)
Leffy
You are my hero, I want to marry you...
Geo Gkolfi
I'm just happy that I can help out. Usually I am the one who needs assistance :-)
Leffy