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 Not Working

  1. #1
    Member OA-OD-JD1's Avatar
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    69
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post
    Blog Entries
    29

    Default [Solved] Eclipse Not Working

    It is working, but for this particular set of code, it won't output anything. For example, the following works fine.

    class apples{
    	public static void main(String args[]){
    		System.out.println("Hello JPF!");
    	}
    }


    The output is as expected - works fine. However, with some slightly more complicated code, absolutely no output is found. When clicking on the run button, the cursor will show that it's loading, but nothing is outputted.


    import java.util.Scanner;
     
    class apples{
    	public static void main(String args[]){
    		Scanner bucky = new Scanner(System.in);
    		System.out.println(bucky.nextLine());
    	}
    }

    Any explanation as to why this is happening would be greatly appreciated. I think it's because we're now importing something, but I'm not sure.
    Last edited by OA-OD-JD1; January 23rd, 2012 at 04:45 PM.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,607
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: Eclipse Not Working

    What do you expect that code to do? And what makes you believe that this is an eclipse issue? Have you tried running this from the command prompt?

    Also, for the future, might I suggest a more detailed title?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Eclipse Not Working

    Add some println's in there (or use a debugger) and step through the code. See http://www.javaprogrammingforums.com...t-println.html

  4. #4
    Member OA-OD-JD1's Avatar
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    69
    My Mood
    Inspired
    Thanks
    9
    Thanked 1 Time in 1 Post
    Blog Entries
    29

    Default Re: Eclipse Not Working

    I feel so stupid. I was expecting a prompt, but I forgot to put one in. Sorry for wasting your time, guys! Problem solved.

Similar Threads

  1. How to make a program into a working .jar? (eclipse)
    By ynnad95 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 16th, 2011, 09:29 PM
  2. working with GWT plugin for eclipse
    By hlahane.tshepo in forum Java IDEs
    Replies: 1
    Last Post: September 7th, 2011, 05:46 AM
  3. Code is working in Eclipse but when exported to Runnable Jar doesn't work
    By jjain.jitendra@gmail.com in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 24th, 2011, 08:12 AM
  4. Replies: 4
    Last Post: January 27th, 2009, 12:03 AM