我正在尝试运行 SQuirreL SQL。
我已经下载并安装了它,但是当我尝试运行它时,我收到以下错误消息:
Java 虚拟机启动器。
找不到主类。
程序将会退出。
我明白了这一点,但我不知道如何解决它。 有什么帮助吗?
更多信息:
- 我使用的是 Windows XP 专业版。
- 我安装了java 1.6,其他应用程序运行正常。
- 安装运行正常。
- 我相信我已正确遵循安装说明。
- 为了运行它,我调用 squirrel-sql.bat 文件。
更新
这个问题:“找不到主类:XX。程序将退出。”< /a> 从 java 开发人员的角度给出了有关此错误的一些背景信息。
I'm trying to run SQuirreL SQL.
I've downloaded it and installed it, but when I try to run it I get this error message:
Java Virtual Machine Launcher.
Could not find the main class.
Program will exit.
I get the gist of this, but I have not idea how to fix it. Any help?
more info:
- I'm on Windows XP pro.
- I have java 1.6 installed, and other apps are running OK.
- The install ran OK.
- I believe I've followed the installation instructions correctly.
- To run it, I'm invoking the squirrel-sql.bat file.
Update
This question: "Could not find the main class: XX. Program will exit." gives some background on this error from the point of view of a java developer.
发布评论
评论(10)
我在使用不同的应用程序 (BI Publisher) 时遇到了同样的问题,因为我在 64 位版本的 Windows 上安装了该应用程序的 32 位版本。
我的案例的解决方案是告诉 BI Publisher 在哪里可以找到 x86 版本的 JRE:
I had the same issue with a different application (BI Publisher) because I installed a 32 bit version of this application on a 64 bit version of Windows.
The solution for my case was to tell BI Publisher where to find the x86 version of JRE:
当我“升级”到 64 位 Windows 7 时,我遇到了这个问题。 我选择的 Java JRE 是 64 位 JVM。 我的机器上有一个用于浏览器的 32 位 JRE,因此我设置了一个系统变量:
当我运行时:
我得到:
这是一个 32 位 JVM。 否则它会显示“Java HotSpot(TM) 64-Bit”。
我编辑了“squirrel-sql.bat”文件,重新标记了第 4 行并添加了第 5 行,如下所示:
现在一切正常,一切正常。
I had this problem when I "upgraded" to Windows 7, which is 64-bit. My go to Java JRE is a 64-bit JVM. I had a 32-bit JRE on my machine for my browser, so I set up a system variable:
When I run:
I get:
Which is a 32-bit JVM. It would say "Java HotSpot(TM) 64-Bit" otherwise.
I edited the "squirrel-sql.bat" file, REMarking out line 4 and adding line 5 as follows:
And now everything works, fine and dandy.
调整 MB 针对 Windows 的答案,将摆脱控制台窗口:
Tweaking MB's answer for windows, will get rid of the console window:
.bat 文件似乎不起作用。
只需双击:
或
在命令行中键入:。
The .bat file does not seem to work.
Just double-click on:
or type:
in the command-line.
您可以放置 .; 在classpath中的环境变量可以克服这个问题。
You can place .; in classpath in environmental variables to overcome this problem.
我尝试启动 SQUirrel 3.1,但收到一条消息,指出“无法找到主类 Files\Rational\ClearQuest\cqjni.jar” 我注意到 C:\Program Files\Rational\ClearQuest\cqjni.jar 位于我现有的类路径中由 Windows 环境变量 CLASSPATH 定义。
SQUirrel 不需要我现有的类路径,因此我更新了 SQUirrel bat 文件 squirrel-sql.bat。
REM SET SQUIRREL_CP=%TMP_CP%;%CLASSPATH%
SET SQUIRREL_CP=%TMP_CP%
它不再将我现有的类路径附加到其类路径中并且运行良好。
I tried to start SQUirrel 3.1 but I received a message stating "Could not find the main class Files\Rational\ClearQuest\cqjni.jar" I noticed that C:\Program Files\Rational\ClearQuest\cqjni.jar is in my existing classpath as defined by the Windows environment variable, CLASSPATH.
SQUirrel doesn't need my existing classpath, so I updated the SQUirrel bat file, squirrel-sql.bat.
REM SET SQUIRREL_CP=%TMP_CP%;%CLASSPATH%
SET SQUIRREL_CP=%TMP_CP%
It no longer appends my existing classpath to its classpath and runs fine.
您是否按照以下说明进行操作:
http://www.squirrelsql.org/#installation
如果是,你是运行批处理文件还是shell脚本来运行它?
Have you followed these instructions:
http://www.squirrelsql.org/#installation
If so, are you running the batch file or the shell script to run it?
类路径是系统在尝试查找您要运行的类时将遵循的路径。 在您尝试执行的批处理文件中,它可能有一个像 CLASSPATH=blah;blah;etc 这样的变量,或者一个看起来类似于的 java 命令,
如果您可以找到或添加该类路径设置,请确保它包含指向squirrel-sql.jar 以及它可能依赖的任何其他 jar 文件,以分号分隔(或安装中可能包含的根 /lib 目录)。
基本上,您只需要告诉 java 在哪里可以找到您要执行的类文件。 维基百科对类路径有更深入的讨论,可以为您提供更多见解。 http://en.wikipedia.org/wiki/Classpath_(Java)
The classpath is the path that the system will follow when trying to find the classes that you're trying to run. In the batch file you're trying to execute it probably has a variable like CLASSPATH=blah;blah;etc or a java command that looks similar to
If you can find or add that classpath setting, make sure that it includes a path to the squirrel-sql.jar and any other jar files that it may depend on separated by semicolons (or the root /lib directory that may be included with the installation).
Basically you just need to tell java where to find the class files that you're trying to execute. Wikipedia has a more indepth discussion about classpath and can offer you more insight. http://en.wikipedia.org/wiki/Classpath_(Java)
您的计算机上安装了 Java 吗? 其 bin 目录的路径是否设置正确(换句话说,如果您从命令行键入“java”,您是否会返回指令列表,或者是否会收到类似“java 未被识别为......”的信息) )?
您可以尝试从命令行(从 squirrel sql 目录)运行 squirrel-sql.jar,使用:
Is Java installed on your computer? Is the path to its bin directory set properly (in other words if you type 'java' from the command line do you get back a list of instructions or do you get something like "java is not recognized as a .....")?
You could try try running
squirrel-sql.jar
from the command line (from the squirrel sql directory), using: