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: Eclipse- All my image files and txt files suddenly disappear, help me find the reason

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

    Default Eclipse- All my image files and txt files suddenly disappear, help me find the reason

    I am now using Eclipse as my IDE, and yesterday I just added some images to the bin folder in my workspace. But today when i try to open them, i find all of them just disappear, along with some txt files I previously added. The bin folder is just left with all the class files. Can anybody tell me the reason? Thanks a lot.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re

    Don't add resources to the bin folder - add them to the src folder. The bin folder is where compiled/copied files from the src folder get placed, which means the older files get deleted when a new build occurs.

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re

    no, when i put the file in the src folder, i cannot form a file reader using its name. only when i put it in the bin folder can i do it. i wonder why.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re

    Quote Originally Posted by jinanzhaorenbo View Post
    no, when i put the file in the src folder, i cannot form a file reader using its name. only when i put it in the bin folder can i do it. i wonder why.
    Post an SSCCE. From what I gather, it sounds like you are trying to access the file directly using a FileReader...access the file as a resource - eg. by using getClass().getResource() or getClass().getResourceAsStream()

Similar Threads

  1. Eclipse Merge Two Files
    By aussiemcgr in forum Java IDEs
    Replies: 0
    Last Post: June 8th, 2012, 01:36 PM
  2. How the Java 2 SDK Tools Find Files
    By Bijaysadhok in forum Java Theory & Questions
    Replies: 0
    Last Post: February 23rd, 2012, 12:01 AM
  3. Seraching through files in a folder for a pattern match inside the files.
    By dazzabiggs in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 2nd, 2011, 08:35 AM
  4. How to edit .class files in Eclipse
    By xbill in forum Java IDEs
    Replies: 2
    Last Post: April 22nd, 2011, 02:31 PM
  5. Replies: 1
    Last Post: March 22nd, 2011, 06:59 PM

Tags for this Thread