gpt4 book ai didi

java - 运行 grails cmd 失败

转载 作者:行者123 更新时间:2023-12-04 19:35:27 24 4
gpt4 key购买 nike

我正在使用 CentOS 和 grails 来托管 Web 应用程序。我在 /.bash_profile 中设置了以下内容:

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk
export PATH=$JAVA_HOME/bin:$PATH
export GRAILS_HOME=/usr/grails/grails-2.5.6
export PATH=$PATH:$GRAILS_HOME/bin
运行 echo $JAVA_HOME :
/usr/lib/jvm/java-1.7.0-openjdk
运行 echo $GRAILS_HOME :
/usr/grails/grails-2.5.6
运行 echo $PATH :
......other_paths......
/usr/lib/jvm/java-1.7.0-openjdk/bin:
/usr/grails/grails-2.5.6/bin:
......other_paths......
运行 java -version :
java version "1.7.0_221"
OpenJDK Runtime Environment (rhel-2.6.18.1.el7-x86_64 u221-b02)
OpenJDK 64-Bit Server VM (build 24.221-b02, mixed mode)
最后,当我运行 grails --version ,控制台向我抛出了以下内容:
| Error java.lang.reflect.InvocationTargetException
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:606)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:236)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)
| Error Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.221-2.6.18.1.el7.x86_64/jre/lib/amd64/libnet.so: libgconf-2.so.4: cannot open shared object file: No such file or directory
| Error at java.lang.ClassLoader$NativeLibrary.load(Native Method)
| Error at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1973)
| Error at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1898)
| Error at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
| Error at java.lang.Runtime.loadLibrary0(Runtime.java:849)
| Error at java.lang.System.loadLibrary(System.java:1088)
| Error at sun.net.PortConfig$1.run(PortConfig.java:47)
| Error at sun.net.PortConfig$1.run(PortConfig.java:45)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at sun.net.PortConfig.<clinit>(PortConfig.java:44)
| Error at java.net.SocketPermission$1.run(SocketPermission.java:1218)
| Error at java.net.SocketPermission$1.run(SocketPermission.java:1210)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.SocketPermission.initEphemeralPorts(SocketPermission.java:1209)
| Error at java.net.SocketPermission.<clinit>(SocketPermission.java:235)
| Error at sun.security.util.SecurityConstants.<clinit>(SecurityConstants.java:259)
| Error at java.lang.Class.getProtectionDomain(Class.java:2194)
| Error at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.define(ClassLoaderForClassArtifacts.java:44)
| Error at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:77)
| Error at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts$1.run(ClassLoaderForClassArtifacts.java:75)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.defineClassAndGetConstructor(ClassLoaderForClassArtifacts.java:75)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compileStaticMethod(CallSiteGenerator.java:246)
| Error at org.codehaus.groovy.reflection.CachedMethod.createStaticMetaMethodSite(CachedMethod.java:290)
| Error at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.createStaticMetaMethodSite(StaticMetaMethodSite.java:114)
| Error at groovy.lang.MetaClassImpl.createStaticSite(MetaClassImpl.java:3411)
| Error at groovy.lang.ExpandoMetaClass.createStaticSite(ExpandoMetaClass.java:1308)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:77)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:162)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
| Error at grails.util.BuildSettings.<init>(BuildSettings.groovy:836)
| Error at grails.util.BuildSettings.<init>(BuildSettings.groovy:832)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:156)
| Error ... 6 more
我已经花了一些时间,但仍然无法解决。有什么好的建议吗?

最佳答案

看起来您的 JVM 缺少一些依赖项。我会卸载/重新安装它。
一些谷歌搜索使我在这里和其他地方发帖,建议 CentOS 附带的 JDK 和/或 JVM 由于许可而特别排除了某些项目,因此重新安装可以确保您拥有干净和完整的副本。

关于java - 运行 grails cmd 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67784967/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com