DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: import

  1. #1
    Huiyuanm Guest

    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!

  2. #2
    Tom Duffy Guest

    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!



  3. #3
    Vikram Rajan Guest

    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links