This page is no longer maintained — Please continue to the home page at www.scala-lang.org

maven and Java 1.6

1 reply
Dustin Whitney
Joined: 2009-02-08,
User offline. Last seen 2 years 32 weeks ago.
Anybody know how I modify my pom.xml to compile my Scala code with java 1.6?  Currently my plugin section looks like so

plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <args>
            <arg>-target:jvm-1.5</arg>
          </args>
        </configuration>
      </plugin>


Changing "jvm-1.5" to "jvm-1.6" gives me the following error:

[WARNING]  scalac error: unknown target 'jvm-1.6'
[WARNING]  scalac -help  gives more information
[WARNING] scalac error: bad option: '-target:jvm-1.6'


Looking at scalac -help, it seems that jvm-1.6 isn't an option.

Any help would be great.  Thanks!

-Dustin
Derek Chen-Becker
Joined: 2008-12-16,
User offline. Last seen 42 years 45 weeks ago.
Re: maven and Java 1.6

Dustin Whitney wrote:
> Anybody know how I modify my pom.xml to compile my Scala code with java
> 1.6? Currently my plugin section looks like so

IIRC the Scala compiler currently only targets up to the 1.5 spec. The
generated files should run fine under a 1.6 JVM. What exactly are you
trying to achieve?

Derek

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland