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: Open file from JAR

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    7
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Open file from JAR

    I have a program that opens a pdf file using AWT's desktop.open(); It works fine when running from Eclipse, but when exported to a jar file,the pdf will not open. Ideas?


  2. #2
    Member
    Join Date
    Jun 2011
    Location
    Rhode Island
    Posts
    69
    My Mood
    Bored
    Thanks
    11
    Thanked 7 Times in 6 Posts

    Default Re: Open file from JAR

    class path in environment variables. My best guess, missing libraries is another.

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    42
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: Open file from JAR

    Quote Originally Posted by StevenTNorris View Post
    I have a program that opens a pdf file using AWT's desktop.open(); It works fine when running from Eclipse, but when exported to a jar file,the pdf will not open. Ideas?
    Check the PDF's file path that your program is about to read, most likely using relative pass causes the problem.

    java exception
    Last edited by hns1984; January 11th, 2012 at 05:54 PM.

Similar Threads

  1. [SOLVED] file deletion/renaming not successful, don't think I have any streams open
    By Bottleskup in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 21st, 2011, 04:14 PM
  2. Replies: 1
    Last Post: April 7th, 2011, 07:01 AM
  3. Replies: 1
    Last Post: March 24th, 2011, 08:22 PM
  4. Suddenly getting "Too Many Open File" error
    By newbie14 in forum Java Networking
    Replies: 4
    Last Post: December 12th, 2010, 10:12 PM
  5. Open Text file
    By java_kiddy in forum File I/O & Other I/O Streams
    Replies: 7
    Last Post: October 5th, 2010, 02:52 AM