I got a source file SampleClass.java but I want to creat
ABC package
here is my script:
======
package jpb;
import java.io.*;
public class SampleClass{
}
==========
when I compile with
javac -d ABC SampleClass.java
I got these message:
The ABC directory does not exist.
Usage: javac <options> <source files>
How come it won't creat ABC dir
Can any one help me to compile this
04-06-2000, 08:29 AM
mike m
Re: Compiling Package
"signor" <sizhnor_rhena@consultant.com> wrote:
>
>I got a source file SampleClass.java but I want to creat
>ABC package
>
>here is my script:
>======
>
>package jpb;
>import java.io.*;
>
>
> public class SampleClass{
> }
>==========
>when I compile with
>javac -d ABC SampleClass.java
>
>I got these message:
>
>The ABC directory does not exist.
>Usage: javac <options> <source files>
>
>How come it won't creat ABC dir
>
>Can any one help me to compile this
From your code segment, you defined your package to be 'jpb' therefore you
should have a directory structure as follows:
d:\JavaPrj\jpb\<added java files in this directory>
Now compile:
1. Change directory back up the tree to the node just above jpb, so in this
case JavaPrj.
2. javac jpb.SampleClass.java
If you want to use ABC as your package then you need to change the directory
structure & the package declaration in the java file to match up.