The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

A package question

Posted by Michael on March 06, 2001 at 9:33 AM

Hi everyone,
Yesterday I try to create my own package and get a frustrate problem.
I wrote the first program:


package util;
public class Vector {
public Vector(){

System.out.println("util.Vector");
}


}

after compile and create a file Vector.java in util directory.

Then I wrote a another program:

import util.*;

public class LibTest {
public static void main(String args[]){

Vector v = new Vector();
}
}

import the class I create before. I set the CLASSPATH=C:\MICHAEL\TEMP and util is the subdirectory of temp.
After I compile it and run the LibTest application, it gave me a
"NoClassDefFoundError" exception, why the second app can't find the first class definition?

Can you help me to figure it out?

Thanks.

Michael






Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us