Results 1 to 18 of 18
  1. #1
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default How to distribute own software in Netbeans?

    Hello everyone I am new to this forum and I will participate often from now on. My first question is I always wondered how to turn my development into a real program and distribute it to my friends etc. I do not want them to have netbeans and running my program from there of course. Does anyone know how to do this in Netbeans? Please help me. Sorry if there is a topic about this before. Please give me a link if so.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Build your project. Right click on your project folder and from the menu select build. If you don't have any errors there NetBeans display a message on output window. Check it.

  3. #3
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    I know about this. It creates a distribute folder in the directory but it does not work on another's pc. It gives the error "main class not found". :confused:
    By the way I was asking about how to make a setup file for my program and then running it on every computer.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Did your project running on NetBeans without an error?

    Did you assign the main class in your project if your project have multiple main classes? Your error message notify that.

    Java distribute as a JAR package as a standard. Since you are using some additional packages in your project, dist folder contain not a single JAR file. You can see a folder name lib also. To distribute your project, had have use the complete dist folder.

    If you are looking to create an executable, then it's not a good idea. Because executable are deals on Windows, not with UNIX systems.

  5. #5
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    The program runs smoothly when I run it in Netbeans. But in another's pc it gives this error which has nothing to do with me. I just send my friend the jar file and that's it. The program does not have any errors. I have only 1 package and did not write anything yet. It is a plain empty program. I just want to know about this because I have been wondering about it for a long time. They taught us how to compile and run it in IDE for years but not how to distribute our programs which I think is ridicilous.

    I am not looking for an exe thing. I want my program to be installed on any other computer just like you install a game on your windows and then running it.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    What's the exact error you get then? Better to provide those details as well. Did you friends' machine have JRE installed?

  7. #7
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    Ok I found the problem thanks Eranga. Before I used to send ONLY the .jar file to my friends and it gave this main class not found error. Then as you said I sent the whole dist folder and then it worked!! :) But it also creates a manifest file in the directory and I read something about it before regarding distribution. Should I also include that file when I distribute my program?

    Now my question is how can I integrate this folder into a setup program so it becomes more neat? I do not want to put it on a CD and people not knowing how to run it. Another reason is that I do not want nobody to see my source codes since they can decompile the .jar file easily.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Juarez View Post
    Ok I found the problem thanks Eranga. Before I used to send ONLY the .jar file to my friends and it gave this main class not found error. Then as you said I sent the whole dist folder and then it worked!! :) But it also creates a manifest file in the directory and I read something about it before regarding distribution. Should I also include that file when I distribute my program?
    Of course you have to. Actually it's always bind with the JAR package, and it defines very important details about your projects, such as main-class information, java version, file version and so on. You cannot avoid that file.


    Quote Originally Posted by Juarez View Post
    Now my question is how can I integrate this folder into a setup program so it becomes more neat? I do not want to put it on a CD and people not knowing how to run it. Another reason is that I do not want nobody to see my source codes since they can decompile the .jar file easily.
    You can think about a msi setup in order to deploy the project in clients' machine. So that you can specify where to deploy and so on.

    Nowadays we can find lots of powerful, freely available decompilers. So that extracting source code is not a difficult task. So you have to think about a best approach to avoid this.

    Here is one solution, which I've use several times.

    SFelix - SFelix Jarsigner - Secure Publication of OSGi Bundles

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    If someone wants to know what you've written then they'll find a way round any obfuscator or compiler trick. Honestly.

  10. #10
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Yeah it could be. Actually it's happening every day. Some of the people are not respect to others knowledge/effort.

  11. #11
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    Yeah true. If they can crack the games from big companies why not see my codes in a simple program. To make it as secure as possible is the only option i think.

  12. #12
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    That's because of Open Source I guess. I mean lots of decompilers are freely available. So people can find them and extract the source from others application. But DLLs like windows resources not like that. You have to paid a lot do unfair things on those. But keep in mind even had pay a lot, still it's happening on Windows resources as well. Depends on peoples attitude.

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    My point is, though, that it's incredibly unlikely you'll save yourself anything by trying to prevent decompilation. You'll just cost yourself time.

  14. #14
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Actually I'm not worrying what really happen after the releasing a product. No point of worrying it. If you can new ideas, new concepts that's it. Developed them and released, you'll be earn more than others, who are copping your stuff.

  15. #15
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    Yea actually that makes sense because all the game companies are rich. They earn it someway. Okay I will just release it then and keep developing my product.

  16. #16
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Good luck. :)

    If you've satisfied with the solution found here please mark the thread as solved. If you don't know how to do it, please check on my signature. You can find a link to relevant explanatons.

  17. #17
    Juarez is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default

    Ah ok I will do that now. Thank you both so much for helping me find the solution :)

  18. #18
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Replies: 0
    Last Post: 01-15-2010, 08:16 AM
  2. Creating a .exe for your software
    By Macca07 in forum New To Java
    Replies: 3
    Last Post: 11-25-2009, 02:24 PM
  3. make my own software?
    By makpandian in forum Advanced Java
    Replies: 6
    Last Post: 01-06-2009, 06:00 PM
  4. Help with Teaching software
    By Doctor Cactus in forum New To Java
    Replies: 3
    Last Post: 11-03-2008, 07:24 PM
  5. Software Engineers
    By pheonix in forum New To Java
    Replies: 17
    Last Post: 09-12-2008, 06:52 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
  •