compiling with a nested directory structure


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: compiling with a nested directory structure

  1. #1
    Arnold Guest

    compiling with a nested directory structure


    I'm getting "resolve symbol" errors when I try to compile source files which
    are in the child directory whose dependent on files from it's parent
    directory. Here's my current directory structure:

    src
    -->a
    ---->b
    ------>util

    What I'm trying to do is compile files which are in the 'util' directory.
    Some of these files use some of the classes in the 'b' directory. My
    compile statement is the following:

    java -d class -classpath src src\a\b\util\aFile.java

    Files in the 'util' directory has a import a.b.* statement on top, but I
    don't think that's the problem, let alone necessary.

    Any assistance would be appreciated.


  2. #2
    Paul Clapham Guest

    Re: compiling with a nested directory structure

    You can't specify a directory for the file you are trying to compile. You
    have to enter

    javac -d class -classpath (something) aFile.java

    and rely on the classpath to direct the compiler to the file. But if you
    have declared aFile to be in the a.b.util package, then you have to enter

    javac -d class -classpath (something) a/b/util/aFile.java

    I'm not going to explain how to set up your classpath when your classes are
    in packages, or even when they aren't. It's a long story. You should be
    able to find something that explains that.

    PC2

    "Arnold" <abc@abc.com> wrote in message news:3c9a5ca1$1@10.1.10.29...
    >
    > I'm getting "resolve symbol" errors when I try to compile source files

    which
    > are in the child directory whose dependent on files from it's parent
    > directory. Here's my current directory structure:
    >
    > src
    > -->a
    > ---->b
    > ------>util
    >
    > What I'm trying to do is compile files which are in the 'util' directory.
    > Some of these files use some of the classes in the 'b' directory. My
    > compile statement is the following:
    >
    > java -d class -classpath src src\a\b\util\aFile.java
    >
    > Files in the 'util' directory has a import a.b.* statement on top, but I
    > don't think that's the problem, let alone necessary.
    >
    > Any assistance would be appreciated.
    >




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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center