# Change Java home path

**URL:** <https://discuss.gradle.org/t/change-java-home-path/38717>\
**Category:** Buildship\
**Created:** [January 7, 2021, 5:20pm UTC](https://discuss.gradle.org/t/change-java-home-path/38717 "2021-01-07T17:20:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![UdoW](https://avatars.discourse-cdn.com/v4/letter/u/f0a364/32.png) [@UdoW](https://discuss.gradle.org/u/UdoW)\
**Post date:** [January 7, 2021, 5:20pm UTC](https://discuss.gradle.org/t/change-java-home-path/38717/1 "2021-01-07T17:20:46Z")

</div>

How could I change the Java home path of a project while I import it into Eclipse?

What is the API call when I know the absolute path to the Java home directory?

Or is it not possible at the moment?

I can change it manually in the project properties but I want to change it with an API while I import the project.

---

<div class="post-metadata">

**Author:** ![UdoW](https://avatars.discourse-cdn.com/v4/letter/u/f0a364/32.png) [@UdoW](https://discuss.gradle.org/u/UdoW)\
**Post date:** [January 8, 2021, 6:20am UTC](https://discuss.gradle.org/t/change-java-home-path/38717/2 "2021-01-08T06:20:42Z")

</div>

I found a way but the API is not really public (all referenced Buildship classes are of discouraged access):

```
ConfigurationManager manager = CorePlugin.configurationManager();
BuildConfiguration currentConfig = manager.loadProjectConfiguration(project);
BuildConfiguration updatedConfig = manager.createBuildConfiguration(...);
manager.saveBuildConfiguration(updatedConfig);

```

Is there another way by using public API?

---

<div class="post-metadata">

**Author:** ![donat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/donat/32/7798_2.png) [@donat](https://discuss.gradle.org/u/donat)\
**Post date:** [January 18, 2021, 4:53pm UTC](https://discuss.gradle.org/t/change-java-home-path/38717/3 "2021-01-18T16:53:55Z")

</div>

Check out `org.eclipse.buildship.core.GradleCore.getWorkspace()`.
