Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:42:25+00:00 2026-06-10T00:42:25+00:00

I am integrating my gradle build files into our eclipse development environment which supports

  • 0

I am integrating my gradle build files into our eclipse development environment which supports multiple JDKs. While most developers have several versions installed, the correct behavior would be to use the “default JRE” as checked on the System Preferences->Java->Installed JREs page.

Is there a way to have gradle set JAVA_HOME (or “org.gradle.java.home”??) to this? If not, any suggestions on the best way to go about this for such a group of developers? This isn’t really a problem for just a single person, it is trying to find a general approach that will scale across the group of us that has me searching!

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:42:27+00:00Added an answer on June 10, 2026 at 12:42 am

    I’m still not completely sure what you are asking for, but here’s a few different takes on it.

    1. If what you want to do is have your code (in Gradle and Eclipse) compile so that the bytecode is compatible with a specific version of Java, use something like this. This does not change the version of Java that either Gradle or Eclipse uses during compilation, just makes the end result “bytecode compatible” with the version you specify. The settings that Luis mentions default to the values set at the more general Java plugin level.

      sourceCompatibility = '1.6' //or '1.5' or '1.7', etc.
      
    2. By default, the Gradle Eclipse plugin will generate the following entry in your .classpath file. I believe this always points to the default you specify in Eclipse, but I may be wrong.

      <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>
      

      If you want to change what that container is, pick the one you are looking for in Eclipse and then look in the .classpath file for the correct container value. Then you can specify it in the build file:

      eclipse.classpath.containers 'whatever the container value is'
      
    3. However if what you want is to be able to change the JAVA_HOME that Gradle runs with to match the default chosen in Eclipse, I think you’ll have a tough time. I’m not sure if there’s a easy place to find that value programmatically. You could probably set it up from the opposite direction though. Have the developers set JAVA_HOME to match what their Eclipse default is. Then they can reference the JAVA_HOME environment variable in the Eclipse config for their JRE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While integrating two subsystems, we were forced to use multiple SessionFactory instances, which lead
I've started integrating doctests into my modules. (Hooray!) These tend to be files which
We're integrating a library into an iPhone app which appears to use the google
Integrating FB Connect into our site using Rails 2.2.2 and Facebooker gem (latest version).
I am integrating growl into my Objective-C app. However If I build and run
I am integrating the MailChimp API into my app and am using a UserObserver
I'm integrating redis into my NodeJS server app, and I'm trying to figure out
I am working on integrating scapy with twisted, but I ran into this very
I am currently integrating lua with C++. For lua I need static methods which
I am integrating Janrain Import contacts in my Cakephp Project. While Using Janrain API

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.