Mac 上的 Spring Roo 设置
Posted
技术标签:
【中文标题】Mac 上的 Spring Roo 设置【英文标题】:Spring Roo Setup on Mac 【发布时间】:2018-11-02 03:26:52 【问题描述】:我一直在阅读有关 Spring Roo 的信息,并且非常想尝试一下,因为它可以为我的团队减少大量手动数据输入类型的工作。但是安装真的让我很生气。
我使用 STS 并将 Roo 作为插件安装,我能够启动 Roo Shell,但它停止在:
"请等待 Roo Shell 完全加载。"
而且我也没有看到任何工作区错误日志。
接下来我尝试在没有 IDE 的情况下在终端上启动,但失败并出现以下错误:
svc-notes-MacBook-Pro:roo-test tkhader$ roo
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.util.SecureAction (file:/Users/tkhader/Documents/Junk/RooAutogen/spring-roo-2.0.0.RELEASE/bin/org.apache.felix.framework-5.4.0.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.util.SecureAction
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ERROR: Bundle com.github.antlrjavaparser.antlr-java-parser [1] Error starting file:/Users/tkhader/Documents/Junk/RooAutogen/spring-roo-2.0.0.RELEASE/bundle/antlr-java-parser-1.0.15.jar (org.osgi.framework.BundleException: Unable to resolve com.github.antlrjavaparser.antlr-java-parser [1](R 1.0): missing requirement [com.github.antlrjavaparser.antlr-java-parser [1](R 1.0)] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime.atn) [caused by: Unable to resolve org.springframework.roo.wrapping.antlr4-runtime [81](R 81.0): missing requirement [org.springframework.roo.wrapping.antlr4-runtime [81](R 81.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.processing)] Unresolved requirements: [[com.github.antlrjavaparser.antlr-java-parser [1](R 1.0)] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime.atn)])
org.osgi.framework.BundleException: Unable to resolve com.github.antlrjavaparser.antlr-java-parser [1](R 1.0): missing requirement [com.github.antlrjavaparser.antlr-java-parser [1](R 1.0)] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime.atn) [caused by: Unable to resolve org.springframework.roo.wrapping.antlr4-runtime [81](R 81.0): missing requirement [org.springframework.roo.wrapping.antlr4-runtime [81](R 81.0)] osgi.wiring.package; (osgi.wiring.package=javax.annotation.processing)] Unresolved requirements: [[com.github.antlrjavaparser.antlr-java-parser [1](R 1.0)] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime.atn)]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.base/java.lang.Thread.run(Thread.java:844)
【问题讨论】:
也不能(还)与 java9 一起工作(并且符合 OSGi 吗?)。所以你需要java 8。 谢谢,成功了 我在 macOS 10.12 中使用 jdk build 1.8.0_121-b13 得到这个““请等待,直到 Roo Shell 完全加载。所以它不限于 jdk 9,尽管说明了具体原因这里可能是。 【参考方案1】:Roo 在 java 9 中不工作,我不得不降级到 java 8,而且它第一次工作。
svc-notes-MacBook-Pro:java6 tkhader$ jenv versions
system
1.6
1.6.0.65
* 1.8 (set by /usr/local/Caskroom/java6/.java-version)
1.8.0.162
9.0
9.0.4
oracle64-1.6.0.65
oracle64-1.8.0.162
oracle64-9.0.4
svc-notes-MacBook-Pro:java6 tkhader$ jenv exec roo
_
___ _ __ _ __(_)_ __ __ _ _ __ ___ ___
/ __| '_ \| '__| | '_ \ / _` | | '__/ _ \ / _ \
\__ \ |_) | | | | | | | (_| | | | | (_) | (_) |
|___/ .__/|_| |_|_| |_|\__, | |_| \___/ \___/
|_| |___/ 2.0.0.RELEASE
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo>
【讨论】:
【参考方案2】:对我来说,有效的改变是将 java 版本从 10/9 更改为 8,
【讨论】:
以上是关于Mac 上的 Spring Roo 设置的主要内容,如果未能解决你的问题,请参考以下文章
如何在 spring roo 项目中安装 JPA 持久性提供程序?
在wildfly上运行war spring roo 2.0.0 RC1