Java Java Objects (Retired) Creating the MVP Prompting for Guesses

Dominik Huber
Dominik Huber
4,631 Points

Console console = System.console() --> Why is it not working in my IDE?


I took this course the 2nd time. Now doing everything without workspace but with my own IDE (Intellij). So now I encountered a problem:

I cant use Console console = System.console() --> It just won't work. Can anyone explain me why it's not working outside of the IDE but it's working on the teamtreehouse workspace?

I have a fix for this:

Scanner scanner = new Scanner(; System.out.println("Please enter a letter: "); String guessAsString =;

But I want to understand why it's not usable in IDE.

I found t his:

I'm wondering what's meant by "usable only outside IDE" ? Where else could you write a programm?


2 Answers

Jeremy Hill
Jeremy Hill
24,307 Points

I could not get it to work in my IDE either. I usually use a Scanner object from importing java.util.Scanner.

Alexander Nikiforov
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,144 Points

You can compile and run the program in Unix console/terminal with Console console code.

That is exactly what they have in Workspaces: Unix console with Bash.

Depending on your OS: you can one start terminal, download files from the workspace and run just like in workspace:

javac and then java Class

If you want to learn why Console is not working in IDE, try for example this discussion:

See the best answer voted: guy gives pretty explicit explanation