Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Getting Started with Java Review: Introduction to Your tools

Console I/O is not working in netbeans or eclipse ??

why Console I/O is not working in netbeans or eclipse ?? Showing error "Exception in thread "main" java.lang.NullPointerException at applet_string.MyClass.main(MyClass.java:18) C:\Users\Sagar\AppData\Local\NetBeans\Cache\8.1\executor- snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds) "

3 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Hi there.

The console object only becomes available when you run your java code via Console/command line interface; Eclipse, being a GUI IDE, has no Console environment.

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Java gives you several means to take user input, such as Scanner class, BufferedReader ... among others.

Check out this popular StackOverflow thread for examples on how to user them. Cheers.

Thank You !!!!!

Then how can i take user input in Eclipse IDE??