-
import
I'm using NT now,and want to import some external file to my program.
But whenever I tried 'import',it only works with 'java.awt.*','java.util.*',and
something like that,while couldn't find some other java file I put by myself.I
tried to compiled some files which worked well before,now they failed!
Is it all right for me do like this:
\myprogram.java (import Io.pack.Io)
\Iopack(a directory)
Why?
Thanks a lot!
-
Re: import
Hello Huiyuanm:
Any file that you import must be referenced in your classpath environment
variable. Have you modified your classpath to point to your new files?
Tom
"Huiyuanm" <mahuiyuan@yahoo.com> wrote:
>
>I'm using NT now,and want to import some external file to my program.
>But whenever I tried 'import',it only works with 'java.awt.*','java.util.*',and
>something like that,while couldn't find some other java file I put by myself.I
>tried to compiled some files which worked well before,now they failed!
>Is it all right for me do like this:
>\myprogram.java (import Io.pack.Io)
>\Iopack(a directory)
>
>Why?
>
>
>
>
>Thanks a lot!
-
Re: import
What you need to do is include the current path in the CLASSPATH environment
variable. The current path is denoted by ".", so all you have to do is append
"." to the CLASSPATH variable.
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