wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes import java.io.Console cannot be resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "import java.io.Console cannot be resolved" Watch "import java.io.Console cannot be resolved" New topic
Author

import java.io.Console cannot be resolved

raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
when i compile the following code

import java.io.Console;
import java.util.regex.Matcher;
....
....

error message was
The import java.io.Console cannot be resolved

i am using jre1.5.0_06
thanks in advance.


live
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It means that there is no such class as Console in the java.io package. Take a look at the API for java.io and see for yourself.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
i saw this code snipet at
http://java.sun.com/docs/books/tutorial/essential/regex/test_harness.html

From there I conclude that in java.io package there must exists a class called Console. But why it is not compile.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
However, it is in Java 6.0: Console

Looks like Sun's Java Tutorial is getting ahead of SCJP 5.0.
raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
Originally posted by Barry Gaunt:
However, it is in Java 6.0: Console

Looks like Sun's Java Tutorial is getting ahead of SCJP 5.0.


that means with my current jre1.5.0_06 it wont compile, isnt it?
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Originally posted by raja kvk:


that means with my current jre1.5.0_06 it wont compile, isnt it?



Um, no it won't, you need the jdk1.6.0. (by the way the jre does not compile, it's the JVM)
[ October 19, 2006: Message edited by: Barry Gaunt ]
raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
Originally posted by Barry Gaunt:



Um, no it won't, you need the jdk1.6.0. (by the way the jre does not compile, it's the JVM)

[ October 19, 2006: Message edited by: Barry Gaunt ]


Where can i get jdk1.6 ? i tried in www.sun.com but confused which one to download. guide me!
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

just try this key word "download jdk1.6.0" on java.sun.com/google there you will found links regarding your.. query.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import java.io.Console cannot be resolved