boatmeme / microsoft-translator-java-api

Java wrapper for the Microsoft Translator API
http://code.google.com/p/microsoft-translator-java-api/
Apache License 2.0
86 stars 61 forks source link

Java Versioning issue #28

Closed boatmeme closed 12 years ago

boatmeme commented 12 years ago

Via email:

Hi Jonathan,

My name is Alex. I'm writing to you in order to make a contribution on microsoft-translator-java-api project. I'm running Linux box and microsoft-translator-java-api has a compilation problem under Linux. Since you didn't specify the version of java in pom file it's going to use 1.3 which is incompatible with the source code as it was done using 1.6 I guess. So my fix is to add few lines into the pom file to specify the version of java to use. I've attached diff file which you can use to import the changes to your project. Also you can add me as a contributor so I can commit those changes as well.

Here are those lines I've added to pom.xml:

<!-- Configure Compiler -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>UTF-8</encoding>
    </configuration>
</plugin>

Here is compilation error I had: $ mvn clean install -Dmaven.skip.test=true [INFO] Compiling 7 source files to /home/user/documents/prj/opensource/microsoft-translator-java-api/target/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure

/home/user/documents/prj/opensource/microsoft-translator-java-api/src/main/java/com/memetix/mst/translate/Translate.java:[126,24] for-each loops are not supported in -source 1.3
(use -source 5 or higher to enable for-each loops)
        for(String text : texts) {

And here is my software installed:

mvn -v

Apache Maven 2.2.1 (rdebian-8)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-5-686" arch: "i386" Family: "unix"

Please let me know if those changes are OK and when it will be deployed to maven repo.

Thanks, -- Alex