# Class EclipseJdt

java.lang.Object
org.gradle.plugins.ide.eclipse.model.EclipseJdt

public abstract class EclipseJdt extends Object
Enables fine-tuning jdt details of the Eclipse plugin

    plugins {
        id 'java'
        id 'eclipse'
    }

    eclipse {
      jdt {
        //if you want to alter the java versions (by default they are configured with gradle java plugin settings):
        sourceCompatibility = 1.6
        targetCompatibility = 1.5
        javaRuntimeName = "J2SE-1.5"

        file {
          //whenMerged closure is the highest voodoo
          //and probably should be used only to solve tricky edge cases.
          //the type passed to the closure is Jdt

          //closure executed after jdt file content is loaded from existing file
          //and after gradle build information is merged
          whenMerged { jdt
            //you can tinker with the Jdt here
          }

          //withProperties allows addition of properties not currently
          //modeled by Gradle
          withProperties { properties ->
              //you can tinker with the Properties here
          }
        }
      }
    }

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EclipseJdt(PropertiesFileContentMerger file)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `file(Closure closure)`
  Deprecated.
  Will be removed in Gradle 10.
  `void`
  `file(Action<? super PropertiesFileContentMerger> action)`
  Deprecated.
  Will be removed in Gradle 10.
  `PropertiesFileContentMerger`
  `getFile()`
  Deprecated.
  Will be removed in Gradle 10.
  `String`
  `getJavaRuntimeName()`
  The name of the Java Runtime to use.
  `JavaVersion`
  `getSourceCompatibility()`
  The source Java language level.
  `JavaVersion`
  `getTargetCompatibility()`
  The target JVM to generate `.class` files for.
  `void`
  `setJavaRuntimeName(String javaRuntimeName)`
  Set Java Runtime name.
  `void`
  `setSourceCompatibility(Object sourceCompatibility)`
  Sets the source compatibility.
  `void`
  `setSourceCompatibility(JavaVersion sourceCompatibility)`
  Sets source compatibility.
  `void`
  `setTargetCompatibility(Object targetCompatibility)`
  Sets the target compatibility.
  `void`
  `setTargetCompatibility(JavaVersion targetCompatibility)`
  Sets target compatibility.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EclipseJdt

    @Inject public EclipseJdt(PropertiesFileContentMerger file)

- ## Method Details

  - ### getSourceCompatibility

    public JavaVersion getSourceCompatibility()
    The source Java language level.

    For example see docs for `EclipseJdt`

    Since:
      1.0

  - ### setSourceCompatibility

    public void setSourceCompatibility(JavaVersion sourceCompatibility)
    Sets source compatibility.
    Since:
      4.0

  - ### setSourceCompatibility

    public void setSourceCompatibility(Object sourceCompatibility)
    Sets the source compatibility.
    Since:
      1.0

  - ### getTargetCompatibility

    public JavaVersion getTargetCompatibility()
    The target JVM to generate `.class` files for.

    For example see docs for `EclipseJdt`

    Since:
      1.0

  - ### setTargetCompatibility

    public void setTargetCompatibility(JavaVersion targetCompatibility)
    Sets target compatibility.
    Since:
      4.0

  - ### setTargetCompatibility

    public void setTargetCompatibility(Object targetCompatibility)
    Sets the target compatibility.
    Since:
      1.0

  - ### getJavaRuntimeName

    public String getJavaRuntimeName()
    The name of the Java Runtime to use.

    For example see docs for `EclipseJdt`

    Since:
      2.11

  - ### setJavaRuntimeName

    public void setJavaRuntimeName(String javaRuntimeName)
    Set Java Runtime name.
    Since:
      2.11

  - ### getFile

    @Deprecated public PropertiesFileContentMerger getFile()
    Deprecated.
    Will be removed in Gradle 10.
    See `file(Action)`
    Since:
      1.0

  - ### file

    @Deprecated public void file(@DelegatesTo(PropertiesFileContentMerger.class) Closure closure)
    Deprecated.
    Will be removed in Gradle 10.
    Enables advanced configuration like affecting the way existing jdt file content is merged with gradle build information

    The object passed to whenMerged{} and beforeMerged{} closures is of type `Jdt`

    The object passed to withProperties{} closures is of type `Properties`

    For example see docs for `EclipseJdt`

    Since:
      1.0

  - ### file

    @Deprecated public void file(Action<? super PropertiesFileContentMerger> action)
    Deprecated.
    Will be removed in Gradle 10.
    Enables advanced configuration like affecting the way existing jdt file content is merged with gradle build information

    The object passed to whenMerged{} and beforeMerged{} actions is of type `Jdt`

    The object passed to withProperties{} actions is of type `Properties`

    For example see docs for `EclipseJdt`

    Since:
      3.5