SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old April 28th, 2008, 05:32 PM
soap soap is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 141 soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 19 h 46 m 33 sec
Reputation Power: 7
Keyboard lib

Hi,

I got the following errors when I tried to import the keyboard package. How do I fix the problem? Thanks.

Code:
import cs1.Keyboard;

public class ReadString
{
	public static void main (String[] args)
	{
		String message;

		System.out.println ("Enter a line of text:");

		message = Keyboard.readString();

		System.out.println ("You entered: \"" + message + "\"");
	}
}


C:\ReadString.java:4: package cs1 does not exist
import cs1.Keyboard;
^
C:\ReadString.java:18: cannot find symbol
symbol : variable Keyboard
location: class ReadString
message = Keyboard.readString();
^
2 errors

Reply With Quote
  #2  
Old April 28th, 2008, 05:49 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,677 stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 3 h 18 m 44 sec
Reputation Power: 301
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
Presumably your instructor has provided this library. They should have also provided information on how to use it. You will need to pass the -classpath or -cp command line argument to the "javac" command.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old May 9th, 2008, 09:32 AM
soap soap is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 141 soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level)soap User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 19 h 46 m 33 sec
Reputation Power: 7
stdunbar,

I am not sure what you mean "You will need to pass the -classpath or -cp command line argument to the "javac" command." Could you please give me an example?

I found the Keyboard library in the cs1 folder and moved the cs1 folder in the folder of my code. Everything works fine now.

Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Keyboard lib


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway