DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Signor Guest

    Accesing User defined Package


    I did create ABC dir which is my package,ABC. All the class which suppose
    to be in ABC package are compiled in ABC directary.

    when I use import ABC.*
    some how it won't recoganize ABC package.

    do I have to set path or something when I install jdk1.2 for this kind of
    user defined package to access or what?
    can you guys help me on this please?

  2. #2
    Paul Balmforth Guest

    Re: Accesing User defined Package



    Make sure that when you compile, you are
    positioned at the package base path.

    Eg.

    contents of \
    ===
    Dir ABC
    ABC1.java
    ABC2.java
    ABC3.java

    Dir App
    Application.java
    ===

    The java file Application should have the
    import statement :

    import ABC.*;

    current directory is \

    javac App\Application.java



  3. #3
    signor Guest

    Re: Accesing User defined Package



    I did the same like Paul wrote but still couldn't recognized ABC package!
    in my application when I did

    javac App\Application.java

    import ABC.*;
    line in my application file got error!


    do I have to set Classpath or anything in JDK1.2 for user defined package
    to access!

    Thank you!
    --------------------------------------


    "Paul Balmforth" <pab_online@yahoo.com> wrote:
    >
    >
    >Make sure that when you compile, you are
    >positioned at the package base path.
    >
    >Eg.
    >
    >contents of \
    >===
    >Dir ABC
    > ABC1.java
    > ABC2.java
    > ABC3.java
    >
    >Dir App
    > Application.java
    >===
    >
    >The java file Application should have the
    >import statement :
    >
    >import ABC.*;
    >
    >current directory is \
    >
    >javac App\Application.java
    >
    >



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