Java 无法在我的电脑上运行

发布于 2024-12-07 07:25:15 字数 249 浏览 1 评论 0原文

我已经在我的 PC 上安装了 Java,并且运行良好。突然出现问题,现在我无法打开 swing 应用程序,并且显示错误“未找到 Java”。但我可以运行 Eclipse IDE,它也需要 Java 才能运行。因此,我决定重新安装 Java,但当我尝试卸载 Java 时,它显示错误 1723 - 此 Windows Installer 程序包有问题。所以我在另一个位置安装了新的JDK并设置了PATH。我仍然无法运行 Swing 应用程序。

有人能帮我解决这个问题吗?

I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.

Can anybody help me on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

-柠檬树下少年和吉他 2024-12-14 07:25:15

您如何运行 swing 应用程序?
如果它是来自 java mySwingApp 之类的命令行,并且您收到 java not found ,那么您的 PATH 设置不正确。确保 java/bin 目录位于您的 PATH 中,而不仅仅是顶级目录。您只需在控制台窗口中输入 java 即可测试您的 PATH - 它应该打印 java 帮助页面。

如果您不是从上述终端运行,那么您可能需要设置一个指向您的 java 安装文件夹的 JAVA_HOME 环境变量。这是设置 JAVA_HOME 的教程
设置 JAVA_HOME

有所帮助,

希望这会

How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.

If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME

Hope this helps,

Will

星光不落少年眉 2024-12-14 07:25:15

这与 jakob 的答案很接近,关于尝试再次正确地设置 Java 安装设置,只是有更多细节。

我在 Windows 7 机器上遇到了类似的问题,我试图卸载 Java 并全新安装较新版本。出现问题,我在卸载并尝试重新安装期间收到 1723 错误消息。以下是有关我如何解决该问题的信息,也许这会对您有所帮助:

查看卸载/重新安装的日志文件。在 Windows 7 上,可以在 c:\users\username\AppData\Local\Temp\ 中找到

java_install.log 没有显示任何额外信息,但我有多个 MSI#### 日志文件,其中包含有关卸载失败的错误消息。消息为:错误 1723。此 Windows Installer 程序包有问题。无法运行完成此安装所需的 DLL。请联系您的支持人员或软件包供应商。操作 UninstallJRE,条目:MSIUninstallJRE,库:C:\Program Files\Java\jre6\bin\regutils.dll

确实没有 regutils.dll 文件,甚至没有 bin目录就在那里。因此,我从另一台计算机复制了 regutils.dll 文件,运行卸载程序,结果成功了。然后新安装的 Java 也可以工作了。

因此,请查看您的日志文件,希望这将为您提供有关 1723 错误的更多详细信息。

This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.

I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:

Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\

The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll

There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.

So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.

开始看清了 2024-12-14 07:25:15

当您手动删除 Java 文件时,通常会发生这种情况。
如果您尝试卸载 Java 但失败,它会生成一个日志文件。
应位于 C:\Users[用户名]\AppData\Local\Temp
几乎在最后就可以找到丢失的文件。
尝试将该文件从工作安装复制到您的计算机。
然后您应该能够卸载 Java 并安装新版本。

This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文