codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Home Page:https://www.codenameone.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Run Config "Xcode iOS Project" fails

kutoman opened this issue · comments

Describe the bug
this is the output at the end of the log:

[INFO] Process return code is 0
[INFO] Executing: 
[INFO] javac -source 1.6 -target 1.6 -classpath *_omitted the paths here_*
[INFO] Executing with timeout -1
[INFO] Warning: [options] Bootstrap Classpath not specified with -source 6
[INFO] Error: Source option 6 is no longer supported. Use 7 or higher.
[INFO] Error: Target option 6 is no longer supported. Use 7 or higher.
[INFO] Process return code is 2

But I couldn't figure it out where 1.6 is set anywhere in the poms.
This (with 1.8)is written in the root pom for example:

  <properties>
    <java.version>1.8</java.version>
    <cn1app.name>app</cn1app.name>
    <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
    <rhino.version>1.7.11</rhino.version>
    <cn1.plugin.version>7.0.95</cn1.plugin.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <java-tests.version>11</java-tests.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <cn1.version>7.0.95</cn1.version>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>

To Reproduce
just running "Xcode iOS Project" config via IntelliJ

Expected behavior
Generating a fresh xcode project

Additional context
I'm not sure if this is a bug, because the config is not that fresh (Beginning of 2022), but why is javac called with 1.6 when maven.compiler.target and maven.compiler.source are set to 1.8?

This will happen when using versions past JDK 11 for the build. I'm not sure if this is something we can fix reasonably.

did you mean JDK 11 and upwards? By default I was using JDK 11 but switching to 1.8 fixed the issue. Thanks!

oh no I was wrong. I falsely thought it was fixed by that change since there was no error on my next attempt to generate the xcode project. But the error wasn't triggered because the recompilation process was skipped. After I changed the common code (providing a reason to force recompiliation) the same error occurs.

when I run mvn --version:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3
Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"