Results 1 to 4 of 4
  1. #1
    counterfox is offline Member
    Join Date
    Mar 2009
    Posts
    45
    Rep Power
    0

    Default Making a netbeans project into a executable jar file

    Hi all,

    Just wondering like i have a netbeans project and can run it from the main there, but is there a way to create a executable jar file from this project? The project I want to test is a console based one, I tried an online tutorial for a GUI which works but cant get a console version to work?

    Any way to do this? Or can anyone point any good tutorials please.

    Thanks

  2. #2
    tashimoto is offline Member
    Join Date
    Sep 2010
    Location
    Oregon, usa
    Posts
    69
    Rep Power
    0

    Default

    I'm using Netbeans and what I do is right click the project in the project pane and click on Clean and Build. This should create a jar file in the dist folder of your project. You should be able to click on the jar file to run your program.

    Hope this helps!
    Chris

    http://netbeans.org/kb/trails/platform.html
    Last edited by tashimoto; 12-03-2010 at 12:22 AM. Reason: added link to Netbeans.org site

  3. #3
    counterfox is offline Member
    Join Date
    Mar 2009
    Posts
    45
    Rep Power
    0

    Default

    Thanks for your reply,

    I tried it and got the jar file. My project like has no GUI its console based, if i double click the jar file nothing happens, do I always have to execute this jar file from command prompt for it to work?

  4. #4
    tashimoto is offline Member
    Join Date
    Sep 2010
    Location
    Oregon, usa
    Posts
    69
    Rep Power
    0

    Default

    That's a good question. I searched "java console based program" and found a link to some code that might help you: Simple Java Console (Swing based) (it has a disclaimer - I haven't used it so I don't know if it will work, but it might help get you pointed in the right direction.)

    I'm not positive, but I think in order to run your console based program you do need to run it from the command prompt. Maybe you could add code to your program that opens a JWindow with a JTextArea (JWindow (Java Platform SE 6) ,JTextArea (Java Platform SE 6))

    Sorry I couldn't be much help.
    Chris

Similar Threads

  1. packing a netbeans project into a jar/exe file
    By newToJava3 in forum New To Java
    Replies: 1
    Last Post: 11-29-2010, 07:33 PM
  2. Replies: 4
    Last Post: 02-24-2010, 01:53 AM
  3. Replies: 3
    Last Post: 09-07-2009, 08:27 AM
  4. Executable java project ..
    By xVent in forum Java Applets
    Replies: 5
    Last Post: 03-29-2009, 06:46 PM
  5. Making Java Application Executable
    By jadaleus in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2008, 12:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •