Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How to run a Java based project with using netbeans everytime.

  1. #1
    Junior Member
    Join Date
    Sep 2017
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to run a Java based project with using netbeans everytime.

    Hi,

    I am new to this forum and dont know Java programming. But I was hoping someone will help me with my problem.

    I am running a free Java based project from Github as per the steps in this website (in the attachment: I am unable to post links as I am a new member
    link.txt)


    It is basically a free tool which is not available in its standalone version. But by following the steps I can run it from netbeans every time.I wanted to know if there is any technique to run the program directly without having to run it through netbeans ie. through an icon (as in the case of other programs like MS Word etc).

    Looking forward to hear from someone.

    Thanks and Regards,
    Arvind Gupta

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: How to run a Java based project with using netbeans everytime.

    any technique to run the program directly
    You can execute the java command with the starting class for the program. Create a batch file with the command line to make it easier.
    In a command prompt in the folder with the starting class file, enter:
    java <STARTCLASSNAME>

    Packaging all the class files and other resources in a jar file will make it easier to transport to other PCs. But that may require some program changes if the code expects to read from files instead of from resources.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Apr 2014
    Posts
    92
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default Re: How to run a Java based project with using netbeans everytime.

    In NetBeans under the Projects tab on the left side, right-click the project and select Clean and Build. When that's finished, it should create a new "dist" folder under your project's main folder (along side the "src", "nbproject", etc folders). You would give (distribute) the "dist" folder to others for them to run your program. Inside the "dist" folder will be a .jar file that can be double-clicked to launch the program stand-alone (outside of NetBeans). That assumes .jar files are properly associated with java.exe in Windows, which is usually the case. Or as Norm said, you can create a batch file launcher, but that's usually unnecessary unless you have a more complex situation like needing JVM parameters to prefer IPv4 over IPv6, or to force OpenGL instead of DirectDraw for graphics.

Similar Threads

  1. [SOLVED] Beginner java: I'm getting one of three errors everytime I run my code?
    By Benner in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 21st, 2013, 12:52 AM
  2. Netflix based java project
    By NewbieJavaProgrammer in forum Object Oriented Programming
    Replies: 2
    Last Post: November 19th, 2012, 04:41 PM
  3. Replies: 2
    Last Post: September 4th, 2012, 03:04 PM
  4. jsp/java based open source project
    By the light in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: July 17th, 2011, 03:24 AM
  5. Com based component project using Java
    By jazz2k8 in forum Java Native Interface
    Replies: 1
    Last Post: October 7th, 2008, 10:54 PM