English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a problem with the imput "cs1". Notice that every time I compile the fie, it shows "The package cs1 does not exist". Afterward, I recognized that I need to find configure path (Keyboard class, package cs1) since is's not part of Java standard class library. Here's my java file: anyone can help me, THANKS A LOT~!

import cs1.Keyboard;


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

System.out.println ("Please type in: ");

message = Keyboard.readString();

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

}
}

2006-09-27 17:05:50 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

with JCreator

2006-09-27 17:07:09 · update #1

2 answers

message = cs1.keyboard.readString();

You have to use the full path when you import

2006-09-27 17:58:02 · answer #1 · answered by Rockstar 6 · 0 0

You need to add whatever jar file has your cs1 package classes in it to the CLASSPATH. From a command line, it's easy to define the CLASSPATH variable using "set". I'm not sure how to do this in JCreator, but looking up CLASSPATH in the help should give you the info you need.

2006-09-28 15:51:48 · answer #2 · answered by Dr.Mr.Ed 5 · 0 0

fedest.com, questions and answers