我正在尝试安装springboot cloud,但是我得到了这个错误dnt知道如何解决它。我设法成功安装了弹簧
spring --version
Spring CLI v2.1.6.RELEASE
spring install org.springframework.cloud:spring-cloud-cli:2.0.0.BUILD-SNAPSHOT
Installing into: /usr/local/Cellar/springboot/2.1.6.RELEASE/lib/ext
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (jar:file:/usr/local/Cellar/springboot/2.1.6.RELEASE/lib/spring-boot-cli-2.1.6.RELEASE.jar!/BOOT-INF/lib/groovy-2.5.7.jar!/) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
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
当我运行此命令后
spring encrypt mysecret --key foo
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:86)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NoSuchMethodError: org.springframework.cloud.cli.command.encrypt.BaseEncryptOptionHandler.option(Ljava/util/Collection;Ljava/lang/String;)Ljoptsimple/OptionSpecBuilder;
at org.springframework.cloud.cli.command.encrypt.BaseEncryptOptionHandler.options(BaseEncryptOptionHandler.java:51)
at org.springframework.boot.cli.command.options.OptionHandler.getParser(OptionHandler.java:68)
at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:83)
at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:53)
at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:218)
at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:170)
at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
... 8 more