473,757 Members | 10,007 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:2 4: cannot resolve symbol
symbol : class Scanner
location : package util
import java.util.Scann er;

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

Greeting.java:8 9: 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 3729
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\j2re 1.4.2_18\bin;
C:\j2sdk1.4.2_1 8\bin;
C:\j2sdk1.4.2_1 3\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\j2re 1.4.2_18\bin\ja vac;
C:\Program Files\Common Files\Adobe\AGL ;
C:\Program Files\MATLAB\R2 007b\bin;
C:\Program Files\MATLAB\R2 007b\bin\win32;
C:\j2sdk1.4.2_1 3\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
3736
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
1701
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 stuff from one of the Symbol SDK examples, and using their .Net classes, drive the scanning engine in my application. Basically the program has a main screen which allows you to perform differing actions, all of which involved the scanner....
9
4552
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 loaded into ArrayList structures when the user performs some action. This list contains a list of barcode numbers that are currently accepted. Finally, there is a manual entry button in my application where the user can
4
4530
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 input (except at some remote sites where there won't be a scanner). The session "knows" whether that site should be keyboard enabled, but unfortunately the output from the scanner is in the form of keypresses! So any attempt to capture and...
7
25945
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. First, I tried using the following: File InFile=new File("input.txt"); Scanner In=new Scanner(InFile);
2
4922
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 a Textbox, it's not working. The Textbox remain blank. Here's the code:
4
20233
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 use RegisterRawInputDevices & WM_INPUT but have no idea where to start. Any help greatly appreciated.
1
1474
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" src="http://100.100.100.233/storyclix/upload.php" style="width:850px; height:120px;" frameborder="0"></iframe> </div> <div class="form-item" name="_Confirm_buttons" id="_Confirm_buttons"> <input type="button" value="Add media" class="form-submit"...
3
2954
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
9489
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7286
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
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 we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.