簡體   English   中英

ActiveMQ Artemis示例的Maven編譯中的NotDirectoryException

[英]NotDirectoryException on maven compilation of ActiveMQ Artemis example

首先,我對這個問題進行了研究,但沒有找到解決問題的方法,因此我開始:

我正在嘗試運行Apache ActiveMQ Artemis(2.5.0)的最新版本提供的示例,該示例是protocol / mqtt / publish-subscribe一個。 正如Apache所說,我嘗試在目錄中運行mvn verify 問題是,它不起作用。 我把輸出放在這里,無論如何我都嘗試了-e和-X,所以不要猶豫問我這個堆棧跟蹤的帖子。

(因為/Library/[....]/lib/modules當然不是目錄,而是文件。我實際上不知道它的作用,但是我嘗試重命名它並創建一個名為“模塊”,而當我嘗試運行其他內容時,它只是創建了錯誤。)

[INFO] Scanning for projects...
[INFO] 
[INFO] --------< org.apache.activemq.examples.mqtt:publish-subscribe >---------
[INFO] Building ActiveMQ Artemis MQTT Publish/Subscribe Example 2.5.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-java) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ publish-subscribe ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ publish-subscribe ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/bouvet/ARTEMIS/apache-artemis-2.5.0/examples/protocols/mqtt/publish-subscribe/src/main/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ publish-subscribe ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/bouvet/ARTEMIS/apache-artemis-2.5.0/examples/protocols/mqtt/publish-subscribe/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.024 s
[INFO] Finished at: 2018-04-23T16:17:15+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project publish-subscribe: Fatal error compiling: CompilerException: InvocationTargetException: java.nio.file.NotDirectoryException: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/modules -> [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

編輯:我試圖將此包含到我的pom.xml中:

    <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>3.7.0</version>
               <configuration>
                   <source>1.8</source>
                   <target>1.8</target>
               </configuration>
            </plugin>
        </plugins>
   </build>

或這個 :

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

但這並沒有改變任何東西:(

編輯II:正如賈斯汀·貝特拉姆(Justin Bertram)所建議的那樣,通過一些研究,我決定至少使用該項目來修改默認使用的JDK,至少對於該項目而言

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_162`

那可能不是最好的方法,因為我可能不得不再次對其進行更改才能與Java 9一起使用,但至少它可以做到這一點。 我現在有一些依賴問題,但是我認為這不是談論的地方,我認為這個問題已經解決。

看來您正在使用Java 9,Apache ActiveMQ Artemis尚不支持Java 9。 嘗試使用Java 8,我想您會看到示例按預期運行。 使用時對我有效:

$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM