472,345 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,345 software developers and data experts.

not recognizing scanner

Hi everyone,

ive had this problem for a while and i cant seem to figure out why. I am using eclipse to create my java code. When import the Scanner class, create a new object and so on... eclipse compiles the code without problem, BUT, when i try to run the same code from command line, i get this error:

Greeting.java:24: cannot resolve symbol
symbol : class Scanner
location : package util
import java.util.Scanner;

Greeting.java:89 cannot resolve symbol
symbol : class Scanner
location : class Greeting Scanner kb = new Scanner<System.in>;

Greeting.java:89: cannot resolve symbol
symbol : class Scanner
location: class Greeting Scanner kb = new Scanner<System.in>;

3 errors

any ideas? FYI, im running java version 6.0, j2sdk1.4.2_13 and 1.4.2_18

Mar 10 '09 #1
6 3464
You need to update your JVM to version 1.5 for Scanner interface to work.
Mar 10 '09 #2
i just did and it's still not working... i get the same error
Mar 10 '09 #3
13,262 8TB
Your PATH variable is still pointing to the old 1.4 jdk. Update your PATH so that it points to at least jdk 1.5.
Mar 10 '09 #4
this is what i have i my Path:

User Variables for Path:
C:\Program Files\Java\j2re1.4.2_18\bin;
C:\Program Files\Java\jdk1.5.0_17\bin;
C:\Program Files\Java\jdk1.6.0\bin;
C:\Program Files\Java\jdk1.6.0_07\bin

System Variables for Path:
C:\Program Files\Java\j2re1.4.2_18\bin\javac;
C:\Program Files\Common Files\Adobe\AGL;
C:\Program Files\MATLAB\R2007b\bin;
C:\Program Files\MATLAB\R2007b\bin\win32;
C:\Program Files\Java\jdk1.5.0_17\bin;
C:\Program Files\Java\jdk1.6.0\bin;
C:\Program Files\Java\jdk1.6.0_07\bin

still same error. I understand the scanner is not being recognized, but when i updated to 1.5.0_17, it should work and no luck. I mean, it still compiles in eclipse just not in command line. I actually had the same problem the first time i installed eclipse on this computer but i don't remember what i did to fix it... it was over 1 year ago :(
Mar 10 '09 #5
13,262 8TB
Edit your path and remove all the references to jdk 1.4
Mar 11 '09 #6
@r035198x thanks =D worked like a charm! really appreciate it!
Mar 11 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: karimt | last post by:
I have a scanner connected to my server running Apache. I would like to have a script that allows me to get a pdf file directly from the scanner....
by: Daniel Bass | last post by:
Symbol MC9000k scanner running Windows Mobile 2003. C# .Net (.Net CF) with OpenNetCf 1.2 installed. Latest Symbol SDK driving the scan engine...
by: Dan =o\) | last post by:
Hey guys, I wonder if you could please provide me with some ideas as to how to get around this problem. Symbol MC9000-k, Pocket PC 2003......
by: teddysnips | last post by:
I posted yesterday about a project I'm involved in to build a login application using a barcode scanner. I've solved most of the problems, but...
by: DemonWasp | last post by:
I've been having some trouble getting the Scanner class to operate the way I'd like. I'm doing some fairly basic file IO and I can't seem to get...
by: chris_gpf1 | last post by:
Hi, I'm working on a website where the user will have to scan a barcode with a serial barcode scanner. I get the scanner working and reading the...
by: Gerry19 | last post by:
Hi All, I'm trying to monitor data passed from a USB Barcode scanner but I can't find any decent code examples of what I need to do, including...
by: thulaseeram | last post by:
hi, i am using the following code for uploading <div id="iframe" name="iframe" style="width:850px; height:120px;"> <iframe...
by: thename1000 | last post by:
Hi, I'm trying to create this output: Input team 1's name: Team 1 Input team 1's ranking: 90.4 etc.
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.