# When I import Java Gradle project to Eclipse, I can't see screen asking for JDK folder

**URL:** <https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748>\
**Category:** Help/Discuss\
**Created:** [February 25, 2017, 12:53am UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748 "2017-02-25T00:53:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 12:53am UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/1 "2017-02-25T00:53:41Z")

</div>

There are several things going wrong and I don’t know how to resolve it.

I have two JDKs one is in C:\Program Files\java\jdk1.8, and another one is in C:\IBM\WAS80\java and I have defined a JAVA\_HOME to point to C:\IBM\WAS80\java.

1. when I import the java gradle project to eclipse ( I installed the buildship 2.0 to the Eclipse), I was given a screen asking for Gradle folder, and I have typed in the location of Gradle 2.14.1. On the same screen I was supposed to see an advanced options which ask me to type in the JDK location, but I don’t see anywhere to ask for this. This is the first question: why I am not shown a text box for me to type in the JDK location?

2. then in my “Gradle Tasks” view I clicked on “war” under build, the build was successful and when I see the log in the console, the JDK location is always “C:\Program Files\java\jdk1.8”, which I should make the gradle build pointing to C:\IBM\WAS80\java?

Any help?

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [February 25, 2017, 1:37am UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/2 "2017-02-25T01:37:10Z")

</div>

The option to specify a JDK location in the advanced options was only available in Buildship 1.x. It was removed in Buildship 2.x with the expectation that you will use the standard `org.gradle.java.home` property to set your JDK/JRE as that will cause both command line and Buildship to function the same. Details of this property are in the User Guide in the [Build Environment](https://docs.gradle.org/current/userguide/build_environment.html) section.

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 1:56am UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/3 "2017-02-25T01:56:37Z")

</div>

Thanks James. I am constructing a gradle.properties file and the content is simply:

org.gradle.java.home=C:\IBM\WAS80\java

But I get an error when importing the project.  
Caused by: org.gradle.api.GradleException: Java home supplied via ‘org.gradle.java.home’ is invalid. Invalid directory: C:IBMWAS80java

I don’t know the syntax. I am using Gradle 2.14.1

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [February 25, 2017, 2:20am UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/4 "2017-02-25T02:20:41Z")

</div>

The gradle.properties file is a standard [Java properties file] ([http://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load(java.io.Reader)](http://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load(java.io.Reader))), so backslashes need to be escaped.

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 2:52pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/5 "2017-02-25T14:52:13Z")

</div>

Thank you James.

yes I did escape them but simply it didn’t work. Can you simply give one example? I also found all the gradle doc just tell you how to do, never give an example, but I think the exampe is the most easy way to let people learn its syntax.

org.gradle.java.home=c:\IBM\WAS80\java

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 2:55pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/6 "2017-02-25T14:55:25Z")

</div>

in my gradle.properties I have tried many combinations like this

org.gradle.java.home=c:\IBM\WAS80\java

or org.gradle.java.home=c:\IBM\WAS80\java

or org.gradle.java.home=c:/IBM/WAS80/\java

however none of them works

---

<div class="post-metadata">

**Author:** ![jjustinic](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jjustinic/32/9005_2.png) [@jjustinic](https://discuss.gradle.org/u/jjustinic)\
**Post date:** [February 25, 2017, 3:21pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/7 "2017-02-25T15:21:29Z")

</div>

If you want to use the backslashes, you need to escape the backslashes and only the backslashes:

```
org.gradle.java.home=c:\\IBM\\WAS80\\java

```

You can also just use forward slashes like the non-Windows platforms use:

```
org.gradle.java.home=c:/IBM/WAS80/java
```

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 5:03pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/8 "2017-02-25T17:03:00Z")

</div>

James, it works now using your syntax. I thought I tried those but it could be that I made a little mistake.

Anyway, Thanks a lot for the help. It is really appreciated!

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 5:08pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/9 "2017-02-25T17:08:05Z")

</div>

the last confusion, in this discussion though, is, why the gradle import and gradle build in the eclipse gui doesn’t take my environment variable definition of JAVA\_HOME in the windows system setting? However if I run “gradlew clean build” in the CLI, gradew does pull the value from JAVA\_HOME in the windows system setting?

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [February 25, 2017, 6:27pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/10 "2017-02-25T18:27:42Z")

</div>

That’s because Eclipse doesn’t use JAVA\_HOME, but instead uses the path specified in eclipse.ini. There is a longstanding [feature request](https://bugs.eclipse.org/bugs/show_bug.cgi?id=102239) to improve that.

---

<div class="post-metadata">

**Author:** ![littleLingzi](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@littleLingzi](https://discuss.gradle.org/u/littleLingzi)\
**Post date:** [February 25, 2017, 6:42pm UTC](https://discuss.gradle.org/t/when-i-import-java-gradle-project-to-eclipse-i-cant-see-screen-asking-for-jdk-folder/21748/11 "2017-02-25T18:42:50Z")

</div>

Many Thanks! You are so helpful,
