Thursday, March 28, 2013

Setting the Classpath in Intellij IDEA

Setting the Classpath in Intellij IDEA:
Way1 :
  1. Open Project Structure (either Ctrl+Alt+Shift+S or File > Project Structure)
  2. Select "Modules" on the far left under Project Settings
  3. Select the module in question in the middle pane
  4. Arrange the order of the dependencies lists. One of the dependencies will be <Module Source> Which ever is listed first will be the one IDEA will give preference to. So if you want the local instance of Foo to be used, make sure <Module Source> is above the dependency.
  1. Right click on any directory in your IntelliJ project, select "Mark Directory As...", and choose "Source Root"
  2. That director folder will change color from yellow to blue; IntelliJ considers all those directories to be in your CLASSPATH.