问题
I have a small issue that I don't know how to solve.
I have started a simple basic JavaFX application and my pom.xml
file looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>se.danielmartensson</groupId>
<artifactId>JNonlinearControl</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-core</artifactId>
<version>1.0.0-beta4</version>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-nlp</artifactId>
<version>1.0.0-beta4</version>
</dependency>
<dependency>
<groupId>org.datavec</groupId>
<artifactId>datavec-api</artifactId>
<version>1.0.0-beta4</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-native-platform</artifactId>
<version>1.0.0-beta4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0-alpha0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>2.0.0-alpha0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<mainClass>se.danielmartensson.JNonlinearControl.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>se.danielmartensson.JNonlinearControl.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
I try to compile with
mvn clean compile assembly:single
It works! But then I try to run
mvn javafx:run
I got these errors below.
Question:
Why can't I compile maven with OpenJFX and Deeplearning4J?
If you look at the errors, it looks like this:
[WARNING] Can't extract module name from X: Invalid module name: X is not a Java identifier
Log when I run mvn javafx:run
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< se.danielmartensson:JNonlinearControl >----------------
[INFO] Building JNonlinearControl 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- javafx-maven-plugin:0.0.1:run (default-cli) @ JNonlinearControl ---
[WARNING] Can't extract module name from protobuf-java-shaded-351-0.9.jar: protobuf.java.shaded.351: Invalid module name: '351' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-windows-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-android-arm64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-linux-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-android-arm.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-linux-armhf.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from datavec-data-image-1.0.0-beta4.jar: Provider class com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderSpi not in module
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-android-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-api-1.0.0-beta4.jar: nd4j.native.api: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-ios-arm64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-platform-1.0.0-beta4.jar: nd4j.native.platform: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from protobuf-java-util-shaded-351-0.9.jar: protobuf.java.util.shaded.351: Invalid module name: '351' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-ios-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-macosx-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-android-x86.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-linux-ppc64le.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
Error occurred during initialization of boot layer
java.lang.module.FindException: Module org.bytedeco.openblas.linux.ppc64le not found, required by org.bytedeco.openblas.platform
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.openjfx.JavaFXRunMojo.executeCommandLine(JavaFXRunMojo.java:525)
at org.openjfx.JavaFXRunMojo.executeCommandLine(JavaFXRunMojo.java:487)
at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:168)
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:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/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)
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.openjfx.JavaFXRunMojo.executeCommandLine(JavaFXRunMojo.java:525)
at org.openjfx.JavaFXRunMojo.executeCommandLine(JavaFXRunMojo.java:487)
at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:168)
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:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/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)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.117 s
[INFO] Finished at: 2019-07-18T02:01:42+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.1:run (default-cli) on project JNonlinearControl: Error: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
来源:https://stackoverflow.com/questions/57085661/why-cant-i-compile-maven-with-openjfx-and-deeplearning4j