You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jean-Philippe Caruana <jp...@target2sell.com> on 2013/10/03 15:24:11 UTC
error with javac: target release 1.6 conflicts with default source
release 1.7
Hi,
back on a java project, I'm translating our build from maven to buildr
(with some maven black magic I would like to kill).
I have a JDK 7 installed but I want to compile to java 6 (our sources
are in java 6), so I wrote in my buildfile :
compile.using :target => '1.6', :other => ['-encoding', 'UTF-8'],
:deprecation => false, :debug => true
But when I run buildr, I've got the following error :
javac: target release 1.6 conflicts with default source release 1.7
What's wrong with my setup or my buildfile ?
Installed versions :
$ java -version # downloaded from oracle and fully working with maven
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
$ buildr --version # installed via apt-get on last stable ubuntu
Buildr 1.4.12
$ uname -a
Linux totoro 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC
2013 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 13.04
Original pom.xml :
<java.version>1.6</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Thanks.
--
Jean-Philippe Caruana - jp@target2sell.com
http://www.target2sell.com
Re: error with javac: target release 1.6 conflicts with default
source release 1.7
Posted by Alex Boisvert <al...@gmail.com>.
No, not new. I think the environment conditions have changed a bit,
though, javac used to be able to respect the :target specification under
all circumstances but it now it can't compile 1.7 source and target 1.6
without explicitly stating it.
In other words, what's new is that people are now using JDK 1.7.
I'll fix the documentation.
On Thu, Oct 3, 2013 at 7:03 AM, Jean-Philippe Caruana <jp...@target2sell.com>wrote:
> Le 03/10/2013 15:40, Alex Boisvert a écrit :
> > You also need to specify :source => '1.6' to your compile options.
>
> Hi Alex,
>
> Thanks, it works !
> Is that new ? In my old buildr days (3 years ago), I just had to specify
> :target and not :source if I recall (I found a working buildfile with
> java 5).
>
> The documentation doesn't say so, see
> https://buildr.apache.org/building.html :
> You can change various compile options by calling, you guessed,
> compile.options. For example, to set the compiler to VM compatibility
> with Java 1.5 and turn on all Lint messages:
>
> compile.options.target = '1.5'
> compile.options.lint = 'all'
>
> Or, if you want to chain methods together:
>
> compile.using :target=>'1.5', :lint=>'all'
>
> --
> Jean-Philippe Caruana - jp@target2sell.com
> http://www.target2sell.com
>
Re: error with javac: target release 1.6 conflicts with default source
release 1.7
Posted by Jean-Philippe Caruana <jp...@target2sell.com>.
Le 03/10/2013 15:40, Alex Boisvert a écrit :
> You also need to specify :source => '1.6' to your compile options.
Hi Alex,
Thanks, it works !
Is that new ? In my old buildr days (3 years ago), I just had to specify
:target and not :source if I recall (I found a working buildfile with
java 5).
The documentation doesn't say so, see
https://buildr.apache.org/building.html :
You can change various compile options by calling, you guessed,
compile.options. For example, to set the compiler to VM compatibility
with Java 1.5 and turn on all Lint messages:
compile.options.target = '1.5'
compile.options.lint = 'all'
Or, if you want to chain methods together:
compile.using :target=>'1.5', :lint=>'all'
--
Jean-Philippe Caruana - jp@target2sell.com
http://www.target2sell.com
Re: error with javac: target release 1.6 conflicts with default
source release 1.7
Posted by Alex Boisvert <al...@gmail.com>.
You also need to specify :source => '1.6' to your compile options.
On Oct 3, 2013 6:24 AM, "Jean-Philippe Caruana" <jp...@target2sell.com> wrote:
> Hi,
>
> back on a java project, I'm translating our build from maven to buildr
> (with some maven black magic I would like to kill).
> I have a JDK 7 installed but I want to compile to java 6 (our sources
> are in java 6), so I wrote in my buildfile :
>
> compile.using :target => '1.6', :other => ['-encoding', 'UTF-8'],
> :deprecation => false, :debug => true
>
> But when I run buildr, I've got the following error :
> javac: target release 1.6 conflicts with default source release 1.7
>
> What's wrong with my setup or my buildfile ?
>
>
> Installed versions :
> $ java -version # downloaded from oracle and fully working with maven
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
>
> $ buildr --version # installed via apt-get on last stable ubuntu
> Buildr 1.4.12
>
> $ uname -a
> Linux totoro 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC
> 2013 x86_64 x86_64 x86_64 GNU/Linux
>
> $ cat /etc/issue
> Ubuntu 13.04
>
>
> Original pom.xml :
> <java.version>1.6</java.version>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>
> Thanks.
> --
> Jean-Philippe Caruana - jp@target2sell.com
> http://www.target2sell.com
>