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 trialKevin Luxmore
895 PointsLearning in Eclipse
I'm trying to do the first exercise in Eclipse rather than the Workspace on the website since I need to learn how to use it anyway, but when I run code I get
"Exception in thread "main" java.lang.NullPointerException at Introductions.main(Introductions.java:8)"
1 Answer
mohmmed alyzeedy
Courses Plus Student 876 Pointsif u want to work with Eclipse or NetBeans
u must first learn about basic of methods and class how to write it .
like the main method if u don't write it, the app will not run and u will face errors about this .
Aaron Arkie
5,345 PointsAaron Arkie
5,345 PointsHello are you talking about the first challenge or the entire lesson in general when writing code in eclipse?
The compiler is telling you that it is finding an error in the main thread which is:
public static void main(String [] args){ // error is in here
}
After digging around the web iv'e read that System.console always throws null. Unfortunately, to use this class it would involve more code. If you are a beginner to java it would be better to use the Scanner class instead. In any case if you want to see where i found this info click here StackOverFlow
Here is my code using the Scanner class.