Results 1 to 6 of 6
  1. #1
    Buster is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Default How to make a runtime version of my java program?

    Letīs say I have made a small system (5 files) in Java on NetBeans for a customer/friend/whatever and now I want to run it on his computer and without him to see the code in the files (so copying the open source files on to his computer is not an option). How do I make an executable version of the 5 files in this system?
    Does he have to install NetBeans on his computer?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,920
    Rep Power
    19

    Default Re: How to make a runtime version of my java program?

    You jar them up and give them the executable jar file.

    Netbeans has full documentation on that.
    Indeed, if it knows which class is your main class in your project, it does do it automatically.
    Is there a dist directory in your project that contains a <your project name>.jar?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Buster is offline Member
    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Default Re: How to make a runtime version of my java program?

    Yes, I found a dist directory with a .jar in some of my projects, but not in all and not in the projects that had only one file with all the classes inside this file.
    What makes this dist directory?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: How to make a runtime version of my java program?

    Since this question is specific to NetBeans, I've moved the thread from New to Java.

    NetBeans comes with a fairly extensive help system. Have you tried to find the answer there?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,920
    Rep Power
    19

    Default Re: How to make a runtime version of my java program?

    Do your classes sit in packages?
    It's possible (I haven't looked) that Netbeans refuses to jar up default-package projects as they are not a Good Thing.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: How to make a runtime version of my java program?

    Quote Originally Posted by Tolls View Post
    It's possible (I haven't looked) that Netbeans refuses to jar up default-package projects as they are not a Good Thing.
    Nope. There's a warning (I think when you create a class in the default package) but they're included in the jar, and even the main class can be in the default package.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 4
    Last Post: 11-21-2012, 01:19 PM
  2. Load Java classes at runtime in a program
    By jfabian in forum Advanced Java
    Replies: 1
    Last Post: 09-19-2012, 08:57 AM
  3. Replies: 13
    Last Post: 12-31-2010, 01:36 AM
  4. Replies: 1
    Last Post: 07-23-2010, 02:42 PM
  5. Replies: 0
    Last Post: 11-06-2008, 12:30 AM

Posting Permissions

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