dl4j中的包不存在

时间:2017-01-05 14:03:58

标签: java maven intellij-idea package cannot-find-symbol

我正在尝试使用1.8 Java 64x JDK在IntelliJ中启动dl4j示例。

我按照description

中的说明进行操作

现在最后一步不起作用。在开始的时候我会得到数百个例外:

 Error:(3,35) java:package org.deeplearning4j.berkeley does not exist 

Error:(19,38) java:cannot find symbol symbol: class BaseLayer

所以我猜这个问题与导入包有关。我需要补充一点,我是IntelliJ的新手。我是否需要考虑一些特别的事情? 是否有可能因为使用Java 8而需要重建Maven的pom.xml?

感谢您的任何想法!

P.S。 maven clean install(版本:3.16.0-4-amd64)抛出一些例外:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:dl4j-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:dl4j-spark:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:dl4j-spark-examples:pom:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:datavec-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:dl4j-cuda-specific-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:nd4j-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:rl4j-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 147, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:arbiter-examples:jar:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ org.deeplearning4j:deeplearning4j-examples-parent:0.7-SNAPSHOT, /home/usr/own installations/idea-IC-163.10154.41/dl4j-examples/pom.xml, line 44, column 21
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.deeplearning4j:deeplearning4j-examples-parent:pom:0.7-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-enforcer-plugin is missing. @ line 44, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] DeepLearning4j Examples Parent
[INFO] DeepLearning4j Examples
[INFO] dl4j-spark-examples
[INFO] dl4j-spark
[INFO] datavec-examples
[INFO] DeepLearning4j CUDA special examples
[INFO] nd4j-examples
[INFO] Reinforcement Learning4j Examples
[INFO] arbiter-examples
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building DeepLearning4j Examples Parent 0.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ deeplearning4j-examples-parent ---
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-default) @ deeplearning4j-examples-parent ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
********** Minimum Maven Version is 3.3.1. Please upgrade Maven before continuing (run "mvn --version" to check). **********
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] DeepLearning4j Examples Parent .................... FAILURE [0.902s]
[INFO] DeepLearning4j Examples ........................... SKIPPED
[INFO] dl4j-spark-examples ............................... SKIPPED
[INFO] dl4j-spark ........................................ SKIPPED
[INFO] datavec-examples .................................. SKIPPED
[INFO] DeepLearning4j CUDA special examples .............. SKIPPED
[INFO] nd4j-examples ..................................... SKIPPED
[INFO] Reinforcement Learning4j Examples ................. SKIPPED
[INFO] arbiter-examples .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.137s
[INFO] Finished at: Thu Jan 05 17:13:18 CET 2017
[INFO] Final Memory: 7M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-default) on project deeplearning4j-examples-parent: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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

1 个答案:

答案 0 :(得分:0)

可能有点晚了,但我有同样的错误......

对我而言,JAVA_HOME变量设置为JRE而不是JDK。 所以将JAVA_HOME变量设置为如下所示:C:\ Program Files \ Java \ jdk1.8.0_112(当然版本不同)

否则会有帮助链接1:http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 还有一些常见的例子可能会失败...