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

Thread: Need help on jar file creation and usage

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Need help on jar file creation and usage

    Hi,

    I have a project in eclipse and i want to create a jar file of the project so that anyone can use it without having access to the code. So i created the executable jar file of the project. Now can anyone please tell me how to use the jar file in another project? I have imported the jar file as an external jar file but what to do after that??


  2. #2
    Member
    Join Date
    Feb 2012
    Posts
    173
    Thanks
    6
    Thanked 10 Times in 10 Posts

    Default Re: Need help on jar file creation and usage

    What is the purpose of this jar file? Are there methods in the jar that you need somewhere else? Is the jar a part of a larger project?

    Also, this thread should be in java theory as this is not specifically an IDE issue.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help on jar file creation and usage

    Quote Originally Posted by aesguitar View Post
    What is the purpose of this jar file? Are there methods in the jar that you need somewhere else? Is the jar a part of a larger project?

    Also, this thread should be in java theory as this is not specifically an IDE issue.
    Hi aesguitar,

    Thanks for your reply. I want to include the jar as an external library in my current project and call the functions present in the jar file. As i am new to java i can't make out how to do that.

    Sorry for any wrong usage of thread, being new to this community i might have missed that.

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Need help on jar file creation and usage

    You import the parts of it you need with import statements, just as you do to use core Java libraries. If you've followed standard package naming conventions, your import statements would look something like:

    import com.ritoban.ClassName;

    If you need more help using packages and/or importing external jar files in Java, I recommend you refer to the corresponding Oracle tutorials.

Similar Threads

  1. Problem with file creation
    By hliasprev in forum Threads
    Replies: 5
    Last Post: May 29th, 2013, 02:37 AM
  2. run jar file inside a jar file?
    By ufrubnuckle in forum Java Theory & Questions
    Replies: 1
    Last Post: February 21st, 2013, 06:58 AM
  3. [SOLVED] jar file Built(clean and build) perfectly, but not running as jar
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: July 11th, 2011, 11:41 AM
  4. WAR file creation in Eclipse JEE
    By katty in forum Java IDEs
    Replies: 5
    Last Post: May 21st, 2009, 09:45 AM