# How to specify Java versions since sourceCompatability is disregarded?

**URL:** <https://discuss.gradle.org/t/how-to-specify-java-versions-since-sourcecompatability-is-disregarded/1117>\
**Category:** Old Forum Archive\
**Created:** [October 24, 2013, 6:01pm UTC](https://discuss.gradle.org/t/how-to-specify-java-versions-since-sourcecompatability-is-disregarded/1117 "2013-10-24T18:01:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Dagnon](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@Chris\_Dagnon](https://discuss.gradle.org/u/Chris_Dagnon)\
**Post date:** [October 24, 2013, 6:01pm UTC](https://discuss.gradle.org/t/how-to-specify-java-versions-since-sourcecompatability-is-disregarded/1117/1 "2013-10-24T18:01:00Z")

</div>

Hello all,

I’m coming into an existing codebase. I’m working with one of several small projects, and I’m having problems running gradle. I’ve gotten “\>gradle eclipse” to work okay, but even then it specifies Java version 1.6 in the generated eclipse files instead of 1.7.

When I do “\>gradle fatJar” it gives me back this:

```gradle
The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties.
Deprecated dynamic property: "sourceCompatability" on "root project 'api'", value: "1.7".
Deprecated dynamic property: "targetCompatability" on "root project 'api'", value: "1.7".

```

So I tried going to the described URL ([http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html](http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html)) but your website only gives me a 404. There also seems to be nothing on the web about how to update these things so they work (again, I assume).

This is my first time with Gradle, and this build.gradle just has these two lines after all the “apply plugin” lines, but no deeper block specification like I’ve seen in other forum posts:

```gradle
sourceCompatability = 1.7
targetCompatability = 1.7

```

“\> gradle -v” says: Gradle 1.8 Groovy: 1.8.6 JVM: 1.6.0\_18 …

It looks like there’s no command-line options for specifying a JVM or Java version, either.

Any hints on how to make this work?

Thanks!

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 24, 2013, 6:21pm UTC](https://discuss.gradle.org/t/how-to-specify-java-versions-since-sourcecompatability-is-disregarded/1117/2 "2013-10-24T18:21:00Z")

</div>

You misspelled the properties, and that’s why you got the warnings. (In Gradle 2.0 these will be errors.) The correct spelling is ‘sourceCompatibility’ and ‘targetCompatibility’.

> So I tried going to the described URL ([http://gradle.org/docs/current/dsl/or](http://gradle.org/docs/current/dsl/or)…) but your website only gives me a 404.

Works fine for me.
