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 trialMihkel Tina
Courses Plus Student 495 PointsOkei so i have done some java before and in Eclipse. The command console.print(); is confusing me and some others.
My concern is that it is confusing me. The work i have done in Eclipse the commands are different then in here.
Mihkel Tina
Courses Plus Student 495 Pointswell for example console.readLine(); does not work in Eclipse and as i understand that is the main place where people actually code. If i learn stuff here in console that are different in Ecplice will i be confused later on?
1 Answer
Steve Hunter
57,712 PointsHi Mihkel,
The issue here is not Eclipse, it is how an IDE handles the Console
instance or, doesn't, more to the point!
You can run a program using Console
in code generated with the IDE but you need to run it outside of the IDE environment. You can create a console application and run that from the command line and it should work fine. If you want to run from within the IDE, try an alternative such as Scanner
or System.in
.
I needn't go on - there are hundreds of Stack Overflow posts with some excellent solutions and workarounds. Have a quick Google.
As for Eclipse being the most popular IDE; maybe it is. Others may prefer Intelli-J but they'd have this problem too. I guess the reason for this is that command line apps aren't really what most people are writing. And if they are, they run them from the command line, not from the IDE.
I hope that helps.
Steve.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsHi Mihkel,
What exactly is confusing you? What else is, or are the others you mention people?
I'm not clear what your question is so I'd like a bit more info so I can try to help.
Steve.