未找到 Java 运行时环境错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23139060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 21:01:25  来源:igfitidea点击:

Java Runtime Environment not found error

javaaptana

提问by Joel Hernandez

I've been working on AptanaStudio and some JRE required software for a bit of time now , but since yesterday something quite odd happened, as suddenly the software that requires it threw me an error No Java virtual machine was found. Last thing I did before that was restoring my system files permissionsthought safe mode as I had some trouble with that , could this have anything to do with it ?

我已经在AptanaStudio 和一些需要 JRE 的软件上工作了一段时间,但是从昨天开始发生了一些非常奇怪的事情,因为突然需要它的软件向我抛出了一个错误No Java virtual machine was found在那之前我做的最后一件事是恢复我的系统文件权限,认为安全模式,因为我遇到了一些问题,这与它有什么关系吗?

I've tried installing JRE once again , no results. However when I run

我再次尝试安装 JRE,没有结果。但是当我跑

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

I do get the following

我确实得到以下信息

java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Aptanagives me the following error

Aptana给我以下错误

No Java virtual machine
was found after searching the following locations:
/Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS/jre/bin/java
java in your current PATH

And other software such as Spinewon't simply start.

而其他软件如Spine不会简单地启动。

My .bash_profile is the following :

我的 .bash_profile 如下:

PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
PATH="/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:${PAT$
export PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home

The output of echo $PATHis the following

的输出echo $PATH如下

/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

The output of echo $JAVA_HOMEis the following

的输出echo $JAVA_HOME如下

/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home

And Java invocations on the terminal work.

和终端上的 Java 调用工作。

Guidance will be highly appreciated.

指导将不胜感激。

JRE Error

JRE 错误

采纳答案by Joel Hernandez

After trying Peter's suggestion the problem persisted but now in another context : "/System/Library/Frameworks/JavaVM.framework" does not contain the JNI_CreateJavaVM symbol"

在尝试了彼得的建议后,问题仍然存在,但现在在另一种情况下: "/System/Library/Frameworks/JavaVM.framework" does not contain the JNI_CreateJavaVM symbol"

After struggling for many hours, and reading about people with the same issue opting to re-install the entire OS , decided to examine the issue from another perspective, the thing I first mentioned here that I believe went unnoticed was that I restored my permissions before this happening, so what I did was the following.

经过几个小时的努力,并阅读有关选择重新安装整个操作系统的相同问题的人,决定从另一个角度检查这个问题,我在这里首先提到的我认为没有引起注意的是我之前恢复了我的权限发生这种情况,所以我所做的是以下内容。

  1. After reading a bunch of articles about Apple no longer providing Java support themselvesbut Oracle providing it, reasoned through it and realized that perhaps paths (Often called directories) from Apple's final Java release may have not been strictly the same as the new Oracle releases, so decided to wipe out all recent Oracle Java Runtime Environmentthat I found on /Library/Java/JavaVirtualMachinesand delete the Java Applet Pluginfrom /Applications (Just search for it on your /Applications path) .
  2. Installed Apple's last stable releasefrom the following link.
  3. Locatedwhere Applelocated their Java releases: /System/Library/Frameworks/
  4. My particular interest was the Java Runtime Environment , so I explored the JavaVMdirectoryon /System/Library/Frameworks/
  5. Found out that all Apple's JRE previous releases reside on a directory called Versionsthat is within /System/Library/Frameworks/JavaVM.frameworkdirectory, here's where I noticed something rare, for some reason at the moment I restored file permissions from my Disk Utility Application , this directory was made inaccessible(By not giving the root user permissions to access anything in itself).
  6. Went to my terminal consoleand inside the JavaVM.frameworkdirectory modified the permissionsto that directory to be accessible for all users by running the following command chmod -R 777 Versions.
  1. 在阅读了一堆关于Apple 不再自己提供 Java 支持而是 Oracle 提供它的文章后,通过它进行推理并意识到 Apple 最终 Java 版本的路径(通常称为目录)可能与新的 Oracle 版本不完全相同,所以决定清除我发现的所有最近的 Oracle Java Runtime Environment/Library/Java/JavaVirtualMachines并从 /Applications 中删除 Java Applet Plugin(只需在您的 /Applications 路径中搜索它)。
  2. 从以下链接安装 Apple 的最新稳定版本
  3. 位于其中苹果位于他们的Java版本/System/Library/Frameworks/
  4. 我特别感兴趣的是Java运行时环境,所以我探索的JavaVM目录/System/Library/Frameworks/
  5. 发现所有 Apple 的 JRE 以前版本都驻留在目录中的一个名为Versions/System/Library/Frameworks/JavaVM.framework目录的目录中,在这里我注意到一些罕见的东西,出于某种原因,当我从我的磁盘实用程序应用程序恢复文件权限时,该目录无法访问(通过不提供访问任何内容的 root 用户权限)。
  6. 转到我的终端控制台并在JavaVM.framework目录中修改该目录的权限,以便所有用户通过运行以下命令来访问该目录chmod -R 777 Versions

After executing these actions I went straight to my JRE-Required software and attempted to open it , success!

执行完这些操作后,我直接进入我的 JRE-Required 软件并尝试打开它,成功

Things to learn from the issue.

从问题中学到的东西。

  • Oracle's Java JDK/JRE are located in different paths from Apple's. (If you are struggling with some other issue, verify your Java version to determine your Java installation directory)
  • Apple's disk utility application might define different permissions than expected for some files. (After restoring permissions verify that everything's working fine, if not this may be the cause of your problems.)
  • Oracle 的 Java JDK/JRE 位于与 Apple 不同的路径中。(如果您遇到其他问题,请验证您的 Java 版本以确定您的 Java 安装目录)
  • Apple 的磁盘实用程序应用程序可能会为某些文件定义与预期不同的权限。(恢复权限后验证一切正常,如果不是,这可能是导致问题的原因。)

回答by Peter Svensson

Looks like AptanaStudio (Eclisebased right?) assumes that you have a JRE inside the Aptana directory (/Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS/jre/bin/java)

看起来像 AptanaStudio(基于 Eclise 的对吧?)假设您在 Aptana 目录中有一个 JRE ( /Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS/jre/bin/java)

I assume that there is nothing there. Simplest way would be to symlink your existing JRE installation to that directory:

我假设那里什么都没有。最简单的方法是将您现有的 JRE 安装符号链接到该目录:

ln -s  /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre /Applications/Aptana\ Studio\ 3/AptanaStudio3.app/Contents/MacOS/jre

Or you could start Aptana from the terminal and specify the path to javawith -vm:

或者你也可以从终端开始的Aptana和指定路径java-vm

./aptana -vm "/path/to/java/bin/directory"

Environment variables that must be available to GUI applications are a bit tricky in OsX (at least in my experience). It is possible to set global PATH(and other variables) in /etc/launchd.conf, see for example hereand /etc/paths.dsee here.

GUI 应用程序必须可用的环境变量在 OsX 中有点棘手(至少以我的经验)。它可以设置全局PATH(和其他变量)中/etc/launchd.conf,例如参见这里/etc/paths.d这里

回答by Hitesh Bisht

Simple Solution

简单的解决方案

For Windows: 1.download the JAVA runtime environment x86(32bit) version else you will get an error with dll file from here http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

对于 Windows: 1. 下载 JAVA 运行时环境 x86(32 位)版本,否则您将从http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155得到 dll 文件错误。 html

  1. Extract the folder out of the .tar file you downloaded.
  2. Rename the JRE folder to "jre"
  3. Then paste it in to this directory C:\Users\"User Name"\AppData\Roaming\Appcelerator\Aptana Studio
  1. 从您下载的 .tar 文件中提取文件夹。
  2. 将 JRE 文件夹重命名为“jre”
  3. 然后将其粘贴到此目录 C:\Users\"User Name"\AppData\Roaming\Appcelerator\Aptana Studio

This worked for me

这对我有用

回答by DDJ

I uninstalled all my Java JREs and JDK for Windows 10. Then I downloaded Aptana again and let it install Java for me. I think JAVA 8 was my problem, but this worked and I can still install the other versions again.

我卸载了所有适用于 Windows 10 的 Java JRE 和 JDK。然后我再次下载了 Aptana,让它为我安装 Java。我认为 JAVA 8 是我的问题,但这有效,我仍然可以再次安装其他版本。