[1829] in java-interest
Re: Importing Classes into Applications
daemon@ATHENA.MIT.EDU (Jonathan Payne)
Mon Sep 18 16:54:20 1995
Date: Mon, 18 Sep 1995 11:09:27 -0700
From: jpayne@starwave.com (Jonathan Payne)
To: gec2@Ra.MsState.Edu
Cc: java-interest@java.sun.com
In-Reply-To: <199509181719.MAA27000@Isis.MsState.Edu> (message from George E Crawford on Mon, 18 Sep 1995 12:19:08 -0500)
You need to make sure your CLASSPATH is set up properly. In this case
I recommend this:
mkdir -p crawford/prata_project
javac crawford/prata_project/Stock.java
javac crawford/prata_project/StockTest.java
This will create
javac crawford/prata_project/Stock.class
javac crawford/prata_project/StockTest.class
Your default classpath = ".", and when the system looks for class
crawford/prata_project/Stock.class it will find it if you are at the
top level.
If you put those classes in the current directory, rather than down in
a directory strucutre which matches your class hierarchy, then you can
see that the resulting classes are *not* in your classpath. Because
the entire class name is used (substituting directories for packages)
when looking up classes.
Make sense?
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com