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: jar files

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    8
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default jar files

    I made/am making a project, and I made a jar file for it. The program executes perfectly when it is in the directory it was created in. When I move it elsewhere, the application does not appear. How can I fix this?


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: jar files

    If you have multiple classes, make sure you pack all the .class files required into the jar file. The alternative is to copy the .class files along with the jar file. There may be other API's that your project is using (such as JExcel, Java3D, Java Sound, etc.) that you'll need to make sure your jar file knows where they are.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    8
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: jar files

    All the files are in the JAR, how do I make it know where the API is if it needs it?

Similar Threads

  1. Java program which can list all files in a given directory
    By JavaPF in forum Java Programming Tutorials
    Replies: 8
    Last Post: July 9th, 2013, 04:38 AM
  2. Reading many files using a scanner
    By jayjames90 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: October 22nd, 2009, 05:35 PM
  3. exe files
    By subhvi in forum Java Theory & Questions
    Replies: 17
    Last Post: September 3rd, 2009, 10:43 AM
  4. getting files in the linux server
    By Truffy in forum Java Networking
    Replies: 36
    Last Post: June 22nd, 2009, 07:32 PM
  5. [SOLVED] Using 3rd Party JAR Files
    By oss_2008 in forum Java Theory & Questions
    Replies: 12
    Last Post: June 12th, 2009, 11:27 AM