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 org.apache.commons.io 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.



Attachment(s):
Screen Shot 2015-05-27 at 4.57.54 pm.png
2 comments
Comment actions Permalink

Looks like http://bugs.java.com/view_bug.do?bug_id=4787931 .

If you are using remote user profile, you may need to relocate IDE folders so that the correct local folder is used: https://intellij-support.jetbrains.com/entries/23348963 .

Or override user.home for IDEA via .vmoptions (https://intellij-support.jetbrains.com/entries/23395793): -Duser.home=<correct path to home folder>.

0
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.

0

Please sign in to leave a comment.