无法找到或加载主类 org.h2.tools.Console [英] Could not find or load main class org.h2.tools.Console
问题描述
我想连接到 h2 控制台.我已经构建了 keycloak 的代码源,现在我在 bin 存储库下,我录制了以下命令
I want to connect to h2 console. I have build the code source of keycloak and now I'm under bin repository and i taped the following command
java -cp jar org.h2.tools.Console -url "$url";-user sa -password"
java -cp jar org.h2.tools.Console -url "$url" -user sa -password ""
连接到 h2 控制台,但出现以下错误
to connect to h2 console but I get the following error
错误:无法找到或加载主类 org.h2.tools.Console引起:java.lang.ClassNotFoundException:org.h2.tools.Console
Error: Could not find or load main class org.h2.tools.Console Caused by: java.lang.ClassNotFoundException: org.h2.tools.Console
推荐答案
我会改用这种方法,它应该可以解决类的问题:
I would use this approach instead, it should resolve the resolution of the class:
java -cp h2-1.4.200.jar org.h2.tools.Console
这将启动控制台.请根据您启动 java 的目录进行相应调整.
This would launch the console. Please adapt accordingly with regards to the directory you're launching java from.
请记住,控制台要求您在控制台 Web 应用程序中输入凭据.
Please keep in mind the console requires you to enter credentials in the console webapp.
这篇关于无法找到或加载主类 org.h2.tools.Console的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!