Java import from other directory

Posted by heldopslippers on Stack Overflow See other posts from Stack Overflow or by heldopslippers
Published on 2010-03-19T09:27:36Z Indexed on 2010/03/19 9:31 UTC
Read the original article Hit count: 154

Filed under:
|

Hi People!

I am building a Enterprise Service Bus (ESB) with Java. I won't get into details But I have to build multiple servers who make use of the same classes.

I have the following directory structure:

/server1
   -Main.java
/server2
    -Main.java
/com
    -Database.java

I want to import from the Main.java class for example the Database.class. But of course the following statements won't work:

import com.Database;

I am working with the javac compiler in the command line (so not eclipse stuff or whatever. just TextMate and the command line). And I found a (pretty stupid) solution by creating a symbolic link in the servers to the com directory. But that is not really an ideal solution.

Does anybody have a better one??

THANXS in advanced!! :D

© Stack Overflow or respective owner

Related posts about java

Related posts about import