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: Working when runned from netbeans not when compiled

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Working when runned from netbeans not when compiled

    I am making image viewer application where images are loaded to memory using BufferedImage with the following code:

    BufferedImage image;
    File path = some path
    InputStream input = new FileInputStream(path);
    image = ImageIO.read(input);

    Application is made so it loads lots of images, with increased heap space up to 1GB. When runned using netbeans it works fine, loading all images it should without any problem. Using jar file it loads untill it uses about 300 mb of RAM and then it stops. I've check where the problem is, after it gets to that point it just wont create new image(line 4 doesnt work). I've tried with more than one set of images so image path should not be the problem i'm looking for.


  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: Working when runned from netbeans not when compiled

    The problem is probably the path. Print out the absolute path for the File object you create to see where the program is looking for the file.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. DecimalFormat error when compiled
    By roofninja in forum What's Wrong With My Code?
    Replies: 6
    Last Post: July 11th, 2012, 10:48 PM
  2. no error when compiled but when the program runs .. help this !!!
    By izzahmed in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 8th, 2011, 08:55 AM
  3. [SOLVED] Compiled .jar won't work (Error-sound)
    By Fermen in forum Object Oriented Programming
    Replies: 2
    Last Post: March 31st, 2011, 05:24 PM
  4. Program compiled/ran as required - FAILED project WHY??????????
    By MISSAJ in forum What's Wrong With My Code?
    Replies: 7
    Last Post: June 23rd, 2010, 03:35 PM
  5. Replies: 4
    Last Post: January 27th, 2009, 12:03 AM