Codenameone: When using gradle 8, you must set the JAVA17_HOME environment variable to the location of a Java 17 JDK

  Kiến thức lập trình

I’ve been unable to build codenameone Android Gradle Projects since upgrading on NetBeans 12.6 to codenameone-maven-plugin:7.0.150. Receiving the following error message:

Generating android gradle Project to /Users/mike/IT/NetBeansProjects/myapp/android/target/myapp-android-1.0-SNAPSHOT-android-source...
Starting android project builder...
Failed to build Android project with error: When using gradle 8, you must set the JAVA17_HOME environment variable to the location of a Java 17 JDK


com.codename1.builders.BuildException: When using gradle 8, you must set the JAVA17_HOME environment variable to the location of a Java 17 JDK
    at com.codename1.builders.AndroidGradleBuilder.getGradleJavaHome (AndroidGradleBuilder.java:440)
    at com.codename1.builders.AndroidGradleBuilder.build (AndroidGradleBuilder.java:489)
    at com.codename1.maven.CN1BuildMojo.doAndroidLocalBuild (CN1BuildMojo.java:847)
    at com.codename1.maven.CN1BuildMojo.createAntProject (CN1BuildMojo.java:562)
    at com.codename1.maven.CN1BuildMojo.executeImpl (CN1BuildMojo.java:116)
    at com.codename1.maven.AbstractCN1Mojo.execute (AbstractCN1Mojo.java:195)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)

Any suggestions? Thx

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT