开发者

Eclipse source file stored in different directory than default

Can I use a file in a project in Eclips开发者_Python百科e that is stored in a different directory than the default without changing the default for all files i.e. other files could be stored in the default directory or other paths?

Example:

in src in a project in eclipse I have three classes

a.java
b.java
c.java

The a.java could be a pointer to a file that is stored in /user/documents/ and b.java a pointer to a file that is stored in users/documents2/


In Eclipse 3.7 it can be done: create a new file (not class) - File/New, Generic/File, and there open the Advanced part of the wizard page, where you can link a file from the file system.

Warning: this needs Eclipse 3.7, in will not work in Eclipse 3.6, and be very careful, as this could mess with e.g. versioning approaches (your partner, who downloads the project from the repository might not have the files in the same location), and you have to make sure manually, that the referenced file gets to the correct Java package.

So, in general, it is possible what you asked, but I do not recommend doing it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜