• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

import java.io.Console cannot be resolved

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
raja kanak
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just try this key word "download jdk1.6.0" on java.sun.com/google there you will found links regarding your.. query.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic