Mubeen Shaik
Posts: 1
Nickname: mubeen
Registered: May, 2004
|
|
Class path problem
|
Posted: May 4, 2004 10:58 AM
|
|
Advertisement
|
Hi all, I am reading Thinking in JAVA and i am trying to compile the following code.It is giving me error on import statement.
code: ----------------------------------------------------------- ---------------------
//: C03: Assignment .java// Assignmnet with objects is bit tricky
import com.bruceeckel.simpletest.*;
class Number
{
int i;
}
public class Assignment {
static Test monitor = new Test();
public static void main(String [] args) {
Number n1 = new Number();
Number n2 = new Number();
n1.i = 9; n2.i = 47;
System.out.println("1 : n1.i : " +n1.i + " , n2.i: " +n2.i);
}
} ///:~
----------------------------------------------------------------------------- ---
==================
Compilation Error
code: ----------------------------------------------------------------- ---------------
C:\JAVA\Think\C03>javac Assignment.javaAssignment.java:5: package com.bruceeckel.simpletest
does not existimport com.bruceeckel.simpletest.*;^
Assignment.java:17: cannot access Testbad class file: C:\com\bruceeckel\simpletest\Test.classclass
file contains wrong class: com.bruceeckel.simpletest.TestPlease remove or
make sure it appears in the correct subdirectory of the classpath. static Test monitor = new Test();
^2 errors
----------------------------------------------------------------------- ---------
My Classpath is as follows
code: ------------------------------------------------------------- -------------------
C:\JAVA Software\lib;C:\JAVA Software\lib\tools.jar;
C:\JAVA Software\lib\dt.jar;C:\JAVA Software\jre\lib\rt.jar;.;
C:\com\bruceeckel\simpletest
------------------------------------------------- -------------------------------
===========
Please help me in compiling and understanding this program. I am sure that, i am missing something in classpath.
Thanks in advance, Mubeen Shaik.
|
|