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 runs not the opened class! Why? :S

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    5
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Eclipse runs not the opened class! Why? :S

    Hello!

    Im a newstarter in Java, im writing the programs of "Java for Dummies". Im by the part, where you
    read & write data from the hard disk. If I run the opened class, it brings no error message and in the console
    I can see, terminated, but not the opened class, but an other one in the package. So the program actually doesn't do what it should.
    Could somebody experienced help me?

    javahelp.JPG

    Thank you very much!
    Zoli


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

    Default Re: Eclipse runs not the opened class! Why? :S

    It's impossible to say how you got to where you are without standing by, looking over your shoulder, but Eclipse's run behavior is sometimes confusing. If you're simply attempting to run the ListAllUserNames program by pushing the green "Run button," Eclipse may be running the last program run which was the ReadAndWrite program. You can see the list of programs in the Run Queue by selecting the drop down triangle next to the Run button, and you'll probably see that ReadAndWrite is at the top of the list.

    The sure way to run the file you want to is to right click the file name in the Project Explorer and then select Run (or Run As . . .), then Java Application (if available). I don't have Eclipse in front of me so am going from memory, but I should be close enough to get you there. After completing these steps, the most recently run program should be at the top of the Run Queue and will be run the next time the Run button is pressed.

    Why is this confusion occurring? Not sure. Maybe because there are two runnable files in the same project . . . Don't know.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    Zoli (August 19th, 2013)

  4. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    5
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Eclipse runs not the opened class! Why? :S

    Hey Greg,

    it worked with Run As... ! Thank you for your help!

    cheers

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

    Default Re: Eclipse runs not the opened class! Why? :S

    You're welcome. Glad to help.

Similar Threads

  1. Replies: 2
    Last Post: November 18th, 2012, 02:09 PM
  2. Saving current state of GUI to be opened later
    By captain in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: April 26th, 2012, 03:29 PM
  3. Eclipse not recognizing my method for class.
    By jerryg in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 9th, 2012, 06:52 PM
  4. Replies: 7
    Last Post: October 13th, 2011, 03:03 AM
  5. Program Runs in Eclipse but Not When Exported
    By Pantheon8 in forum Java IDEs
    Replies: 2
    Last Post: August 17th, 2011, 05:57 PM