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 2 of 2

Thread: How to compile a .jar from existing src in IntelliJ IDEA

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Location
    UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to compile a .jar from existing src in IntelliJ IDEA

    Hi everyone, great to meet you!

    I'm a complete beginner and I'm learning how to use IntelliJ, and still getting my head around concepts like packages, classes, etc.

    To begin with, one of the things I'd like to try is taking an existing src with working code (used with permission from the developer), and try to compile it to a .jar file, without changing anything, just to see if the compilation process works.

    I'm having great difficulty figuring out exactly how to do this. I have the project open in IntelliJ, with the src folder within the project files on the left. I know that I need to open [something] in a Terminal window, and type "javac [something].java", the problem is that I don't know what the [somethings] are supposed to be.

    Can any offer a simple, easy-to-follow, step-by-step solution to this? I'll be extremely grateful if you can, since so far all the Googling in the world has led me to setting up an account here in order to ask you guys 😊

    Please be prepared for me to not understand at least one of the steps, and need clarification on it.

    Thanks in advance!

    - Willicious

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

    Default Re: How to compile a .jar from existing src in IntelliJ IDEA

    Moved to IDE section.

    Using basic java tools, a jar file is built by
    first compiling(using javac) the source(files ending with .java) which creates .class files
    then creating a manifest file with the program's starting class(has main method)
    and then using the jar command to put all the parts into the jar file.

    I assume most IDEs do all that.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Is IntelliJ IDEA
    By adisharma in forum Java IDEs
    Replies: 2
    Last Post: January 14th, 2021, 11:15 PM
  2. Replies: 1
    Last Post: June 11th, 2018, 01:47 PM
  3. Java compile error in Intellij IDEA 13.1
    By ajp in forum Java IDEs
    Replies: 3
    Last Post: May 29th, 2014, 05:58 PM
  4. Hibernate in IntelliJ IDEA
    By manjula in forum Java IDEs
    Replies: 0
    Last Post: May 14th, 2012, 06:54 AM