473,513 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

not recognizing scanner

74 New Member
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

thx
Mar 10 '09 #1
6 3701
Jibran
30 New Member
You need to update your JVM to version 1.5 for Scanner interface to work.
Mar 10 '09 #2
rotaryfreak
74 New Member
i just did and it's still not working... i get the same error
Mar 10 '09 #3
r035198x
13,262 MVP
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
rotaryfreak
74 New Member
this is what i have i my Path:

User Variables for Path:
C:\Program Files\Java\j2re1.4.2_18\bin;
C:\j2sdk1.4.2_18\bin;
C:\j2sdk1.4.2_13\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:\j2sdk1.4.2_13\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


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
r035198x
13,262 MVP
Edit your path and remove all the references to jdk 1.4
Mar 11 '09 #6
rotaryfreak
74 New Member
@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

4
3688
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. Is this do-able?
0
1688
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 stuff. I've extracted the barcode scanner handling...
9
4543
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... With a scanner application I've written, data is...
4
4503
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 one remains. The client want to disable keyboard...
7
25864
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 the class to load the last line/token any way I try....
2
4894
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 barcode, but when I want to write the string in...
4
20173
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 any references I need to include. I know I need to...
1
1455
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 name="attach_frame" id="attach_frame"...
3
2933
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.
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.