Spring roo 不适用于 Java 11 的 Apple M1

Spring roo won't work on Apple M1 with Java 11

我有一个漂亮的新 Apple M1 machine。 我很高兴与 Java 8 一起蹒跚学步,但 Eclipse 想要 Java 11,所以我已更新到 Java 11。

Spring roo 的问题起源于 Eclipse SpringToolSuite4,我尝试并失败了启动 roo shell。但是我后来发现问题不在 SpringToolSuite 安装中,而在 roo 本身。

我非常乐意在 Eclipse/STS 之外与 roo 一起工作。 因此,我尝试从命令行启动 ./roo.sh,但发现了大量错误,其中一些错误包含在下面。

有人知道发生了什么事吗?从 shell 启动 Spring roo 在我的旧 mac.

上继续正常工作

spring-roo-1.3.2.RC1spring-roo-2.0.0.M1 都会发生这种情况。

查看随 roo 提供的 felix .jar 中的 default.properties,我注意到 arm 处理器没有别名,这意味着什么吗?

# Native Processor Aliases.  Format is felix.native.processor.alias.<normalized Processor Name>=alias1,alias2
felix.native.processor.alias.68k=
felix.native.processor.alias.arm=
felix.native.processor.alias.arm_le=
felix.native.processor.alias.arm_be=
felix.native.processor.alias.alpha=
felix.native.processor.alias.ignite=psc1k
felix.native.processor.alias.mips=
felix.native.processor.alias.parisc=
felix.native.processor.alias.powerpc=power,ppc
felix.native.processor.alias.x86=pentium,i386,i486,i586,i686
felix.native.processor.alias.x86-64=amd64,em64t,x86_64
felix.native.processor.alias.sparc=

所有的错误似乎都在这一行通过 Felix:

org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002)

malcolm@MacBook-Pro-2 bin % ./roo.sh WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.felix.framework.util.SecureAction (file:/Users/malcolm/springRoo/spring-roo-1.3.2.RC1/bin/org.apache.felix.framework-4.4.1.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 [3] Error starting file:/Users/malcolm/springRoo/spring-roo-1.3.2.RC1/bundle/antlr-java-parser-1.0.15.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.github.antlrjavaparser.antlr-java-parser [3]: Unable to resolve 3.0: missing requirement [3.0] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime) [caused by: Unable to resolve 78.0: missing requirement [78.0] osgi.wiring.package; (osgi.wiring.package=javax.annotation.processing)]) org.osgi.framework.BundleException: Unresolved constraint in bundle com.github.antlrjavaparser.antlr-java-parser [3]: Unable to resolve 3.0: missing requirement [3.0] osgi.wiring.package; (osgi.wiring.package=org.antlr.v4.runtime) [caused by: Unable to resolve 78.0: missing requirement [78.0] osgi.wiring.package; (osgi.wiring.package=javax.annotation.processing)] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002) at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.base/java.lang.Thread.run(Thread.java:829) ERROR: Bundle org.objectweb.asm.all [8] Error starting file:/Users/malcolm/springRoo/spring-roo-1.3.2.RC1/bundle/asm-all-5.0.2.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.objectweb.asm.all [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.ee; (&(osgi.ee=JavaSE)(version=1.3.0))) org.osgi.framework.BundleException: Unresolved constraint in bundle org.objectweb.asm.all [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.ee; (&(osgi.ee=JavaSE)(version=1.3.0)) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002) at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.base/java.lang.Thread.run(Thread.java:829) ERROR: Bundle org.springframework.roo.addon.backup [22] Error starting file:/Users/malcolm/springRoo/spring-roo-1.3.2.RC1/bundle/org.springframework.roo.addon.backup-1.3.2.RC1.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.roo.addon.backup [22]: Unable to resolve 22.0: missing requirement [22.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.process.manager)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 66.0: missing requirement [66.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.file.monitor)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 60.0: missing requirement [60.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.support.util)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 73.0: missing requirement [73.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.namespace)]]]) org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.roo.addon.backup [22]: Unable to resolve 22.0: missing requirement [22.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.process.manager)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 66.0: missing requirement [66.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.file.monitor)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 60.0: missing requirement [60.0] osgi.wiring.package; (&(osgi.wiring.package=org.springframework.roo.support.util)(version>=1.3.0)(!(version>=2.0.0))) [caused by: Unable to resolve 73.0: missing requirement [73.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.namespace)]]] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002) at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.base/java.lang.Thread.run(Thread.java:829) ERROR: Bundle org.springframework.roo.addon.cloud [23] Error starting file:/Users/malcolm/springRoo/spring-roo-1.3.2.RC1/bundle/org.springframework.roo.addon.cloud-1.3.2.RC1.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.roo.addon.cloud [23]: Unable to resolve 23.0: missing requirement [23.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.parsers)) org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.roo.addon.cloud [23]: Unable to resolve 23.0: missing requirement [23.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.parsers) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002) at org.apache.felix.framework.Felix.startBundle(Felix.java:2045) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.base/java.lang.Thread.run(Thread.java:829)

很遗憾,这个问题只有一个可能的答案,因为 roo 将不再受支持。

roo 项目从一开始就被设想为允许您删除它以及所有 aspectj .aj 文件,留下正常的工作 .java 文件。这真的很整洁,就像整个项目一样。

只需右键单击该项目(如果收到任何错误消息,请先清理它)选择 Refactor > Push In.. 并确认。

这让我有了完美的工作代码,所以我很高兴。

感谢 Spring Roo 的构思和工作人员,这真是太棒了。它使 Hibernate 变得如此简单,并且用户界面是世界级的 class.