Mar 13, 2014

f Comment

How To Make a Folder Use Another Folder as part of Source Code in Eclipse?

Amazon Suppose I have two folders in my workspace in Eclipse IDE. How do I make it so that one folder uses the other folder as part of the source code? In other words, how do I make Eclipse use a folder that contains Java source code as part of the Java source code for another folder? I'd like the Java source code inside directory A to use the Java source code inside directory B.

In Eclipse IDE, how do I link a Java project to a folder full of Java source code files? Or how do I link a folder full of Java source code files to my Java project?

Read on to see the solution.


Let's say that the project's name is MultiMediaPlayer.

Open your Eclipse workspace and navigate to the following location in MultiMediaPlayer:

Java Build Path -> Source -> Link Source -> Browse

Select the folder that you want to link to. Let's say the folder is C:\Users\michael.wen\git\base\core\java.

Once you are done you'll see that under MultiMediaPlayer there is a java folder. In this folder you will see source code files that are identical to C:\Users\michael.wen\git\base\core\java. They actually mirror each other and any update you make to one file is immediately reflected in the other counterpart.

Note that the java folder is just a view you see in Eclipse so you know that MultiMediaPlayer is linked to this source code folder. Such folder does not exist on the disk.

Questions? Let me know!
Please leave a comment here!
One Minute Information - by Michael Wen
ADVERTISING WITH US - Direct your advertising requests to Michael