Re: How to include *.class file with package in CLASSPATH?
- From: Lion-O <nosp@xxxxxxxxxxxxxx>
- Date: Sat, 26 Apr 2008 10:26:02 -0500
On 2008-04-26, Ulf Meinhardt <ulf2m@xxxxxxxxx> wrote:
D:\java\output\aaa\bbb\ccc\myclass.class
myclass.java contains the following package information:
package aaa.bbb.ccc;
The current path in the command prompt is
D:\java>
---<CUT
But when I enter a statement like:
javac -cp D:\java\output\aaa\bbb\ccc;%CLASSPATH% test.java
then the compiler complains that he cannot find myclass:
Try thinking of packages being directories when you're working on the
commandline. You already seem to be doing that since you've setup a directory
structure aaa\bbb\ccc. Now, in order to find the classes in the package the
compiler expects to be able and access a directory structure aaa\bbb\ccc which
then contains myclass.class.
But your classpath doesn't have that, it only points to the directory where
myclass.class resides but that directory doesn't contain the actual directory
structure.
Try just compiling without setting any classpath, or, if your classpath
contains specific settings try: javac -cp .;%CLASSPATH test.java
Groetjes, Peter
--
..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc
.
- Follow-Ups:
- Prev by Date: Re: simple help about JFileChooser
- Next by Date: Re: How to check if all *.jars in my CLASSPATH really exists? Automatic check (not manual) possible?
- Previous by thread: simple help about JFileChooser
- Next by thread: Re: How to include *.class file with package in CLASSPATH?
- Index(es):
Relevant Pages
|