0

I've been trying to create a runConfiguration within Eclipse for a gradle project I'm working on. When I tried saving it as a local file which created a .launch file, it has a parameter

    <stringAttribute key="java_home" value="/Library/Java/JavaVirtualMachines/java-sdk/Contents/Home"/>

Is it possible to have value as ${JAVA_HOME} instead of using my local directory?

Edit: Adding the full launch config file.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.buildship.core.launch.runconfiguration">
    <listAttribute key="arguments"/>
    <booleanAttribute key="build_scans_enabled" value="false"/>
    <stringAttribute key="gradle_distribution" value="GRADLE_DISTRIBUTION(LOCAL_INSTALLATION(/opt/gradle/gradle-7.3.3))"/>
    <stringAttribute key="gradle_user_home" value="/Users/harishankarv/.gradle"/>
    <stringAttribute key="java_home" value="/Library/Java/JavaVirtualMachines/java-sdk/Contents/Home"/>
    <listAttribute key="jvm_arguments"/>
    <booleanAttribute key="offline_mode" value="false"/>
    <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
    <booleanAttribute key="override_workspace_settings" value="false"/>
    <booleanAttribute key="show_console_view" value="true"/>
    <booleanAttribute key="show_execution_view" value="true"/>
    <listAttribute key="tasks">
        <listEntry value="installJars"/>
    </listAttribute>
    <stringAttribute key="working_dir" value="${workspace_loc:/project_name}"/>
</launchConfiguration>

enter image description here

Hari
  • 3
  • 5
  • Eclispe doesn't use JAVA_HOME and I don't know what might be setting that `stringAttribute` in the launch config. Please edit the question to include the full .launch file and show screen shots of the launch config edit window. – E-Riz Nov 29 '22 at 14:07
  • 1
    I don't know if variables are resolved in a Gradle run configuration in the _Java home_ field, but if so, it has to be `${env_var:JAVA_HOME}`. – howlger Nov 29 '22 at 14:48
  • So, does that mean that we cannot include runConfiguration's launch file in our project repo so others could use it? – Hari Nov 30 '22 at 12:27

0 Answers0