-
Compiling Package
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
-
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.
Cheers,
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks