Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Basics Getting Started with Java Receiving Input

Okei 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.

Hi 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.


well 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

Hi 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.