user847988
user847988

Reputation: 984

Eclipse source file stored in different directory than default

Can I use a file in a project in Eclipse 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/

Upvotes: 0

Views: 374

Answers (1)

Zoltán Ujhelyi
Zoltán Ujhelyi

Reputation: 13858

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.

Upvotes: 1

Related Questions