Java project does not build on windows 8.1 and Java 1.7 if dependency jar is not inside the project directory

I am using windows 8.1-64bit and Java 1.7.0_79 and Intellij idea community edition 14.1.2.

In a simple Java project I have dependency jar marked and the jar resides outside the project under C:/Users/username/Appdata/Roaming/lib/commons-io.jar. The project has just a single java file using a helper from FileUtils in apache commons-io.

There are no compilation errors marked on the editor. When I build the project it gives me a compilation error:

Error:(1, 29) java: package does not exist
Error:(5, 28) java: cannot find symbol
  symbol:   variable FileUtils
  location: class MyClass

However if i copy this jar into the project and mark as a dependency the project build fine. It seems to be specific to the fact that the jar dependency is outside the project directory.

On switching to java 8, the issue does not occur and is specific to Java 7 and happens only on windows (Could not reproduce it on MacOS)

Any ideas what may be causing this ?

I have attached a screenshot showing the editor with no compilation error and the project build failure.

Screen Shot 2015-05-27 at 4.57.54 pm.png
Comment actions Permalink

Looks like .

If you are using remote user profile, you may need to relocate IDE folders so that the correct local folder is used: .

Or override user.home for IDEA via .vmoptions ( -Duser.home=<correct path to home folder>.

Comment actions Permalink

Thanks for the update. You were right about the cause of the issue.

Setting -Duser.home=<user home> in the IDEA_INSTALLATION\bin\idea.exe.vmoptions fixed it.


Please sign in to leave a comment.