由于"包不可见"错误,无法在Ubuntu上构建ANTLR4



我正试图使用maven:在Ubuntu上构建ANTLR4

mvn install -DskipTests

但它抛出了以下错误:

CommentHasStringValueProcessor.java:[9,27] package com.sun.tools.javac.main is not visible
(package com.sun.tools.javac.main is declared in module jdk.compiler, which does not export it to the unnamed module)
CommentHasStringValueProcessor.java:[11,27] package com.sun.tools.javac.tree is not visible
...

我尝试使用StackOverflow的不同解决方案,但没有帮助。有人能详细说明我到底应该解决什么问题吗?

出于某种原因,它在Windows上运行。

ANTLR4,Ubuntu 20.04构建示例。

sudo apt install openjdk-11-jre-headless maven
cd /home/name/tmp/
git clone https://github.com/antlr/antlr4.git
cd antlr4/
export MAVEN_OPTS="-Xmx1G"
mvn clean
mvn -DskipTests install
.
[INFO] BUILD SUCCESS
[INFO] -----------------------------------------
[INFO] Total time:  01:21 min
[INFO] Finished at: 2021-12-02T23:31:50+01:00
[INFO] -----------------------------------------

参考。https://github.com/antlr/antlr4/blob/master/doc/building-antlr.md

相关内容

  • 没有找到相关文章

最新更新