为什么它在安装 weblogic 服务器时显示您的 JDK c:program files\java\jre7 不是有效的 JDK?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37001407/
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-11 18:53:59  来源:igfitidea点击:

Why its showing your JDK c:program files\java\jre7 is not a valid JDK while instaling weblogic server?

javaweblogic

提问by user2866685

Error image

错误图片

It's showing -

它显示——

This installer must be executed using a Java Development Kit (JDK)
but C:\Program Files\Java\jre7 is not a valid JDK.

- while instaling weblogic server.

- 在安装 weblogic 服务器时。

I have installed the 64 bit JDK version 1.7. Please tell where I am making a mistake?

我已经安装了 64 位 JDK 1.7 版。请告诉我哪里出错了?

回答by Ray

The JRE is the Java Runtime Environment - what is needed just to run "regular" Java software. It's part of the JDK, but not the complete package. The JDK includes the JRE plus developer tools e.g. the Java Compiler. Weblogic's installer apparently needs the full JDK, not only the JRE.

JRE 是 Java 运行时环境 - 只需要运行“常规”Java 软件即可。它是 JDK 的一部分,但不是完整的包。JDK 包括 JRE 和开发人员工具,例如 Java 编译器。Weblogic 的安装程序显然需要完整的 JDK,而不仅仅是 JRE。

If you installed the JDK, you should be able to find it on your hard drive (e.g. C:\Program Files\Java\jdk1.7_<something>). The path in your screenshot is only the "raw" JRE.

如果您安装了 JDK,您应该能够在您的硬盘驱动器上找到它(例如C:\Program Files\Java\jdk1.7_<something>)。屏幕截图中的路径只是“原始”JRE。

回答by sanastasiadis

You must provide the correct path to your JDK (not the JRE) in the system variable JDK_HOME.

您必须在系统变量中提供 JDK(而不是 JRE)的正确路径JDK_HOME

You could also change the JAVA_HOMEvariable to point at your installed JDK.

您还可以更改JAVA_HOME变量以指向已安装的 JDK。

Your PATHsystem variable should also use the correct path to the JDK, and it would be useful if you could provide the result of the command: java -version.

你的PATH系统变量也应该使用正确的 JDK 路径,如果你能提供命令的结果会很有用:java -version.

Have a look also here: https://docs.oracle.com/cd/E24329_01/doc.1211/e24492/console.htm#WLSIG128

也看看这里:https: //docs.oracle.com/cd/E24329_01/doc.1211/e24492/console.htm#WLSIG128

回答by Slettal

You have to set the variable JAVA_HOME, but also add the jdk bin folder to the PATH variable. (type in the console window you use to start the weblogic installer)

您必须设置变量 JAVA_HOME,还要将 jdk bin 文件夹添加到 PATH 变量中。(在用于启动 weblogic 安装程序的控制台窗口中键入)

It should look similiar to this example:

它应该类似于这个例子:

set JAVA_HOME=C:\develop\jdk1.8.0_66
set path=C:\develop\jdk1.8.0_66\bin;%path%

回答by Ashishkumar Singh

Though this is an old thread, but still, I want to share how I resolved this issue because I wasn't able to find appropriate answer for this issue

虽然这是一个旧线程,但我仍然想分享我如何解决这个问题,因为我无法找到这个问题的合适答案

My Observation: Go to Control Panel -> Java -> View ->Here you can find all the JRE installed on you're system. As expected, when we update our jre, it is selected by default to run any java application.

My Observation:转到Control Panel -> Java -> View ->此处您可以找到系统上安装的所有 JRE。正如预期的那样,当我们更新 jre 时,默认情况下会选择它来运行任何 Java 应用程序。

On my system, I have installed jdk1.8.0_73but it still was giving error for jre1.8.0_91. I checked for the jre updates and found that, this was the most updated JRE on my system. So, I uninstalled jre1.8.0_91expecting that it now pick up the installed JDK jre of my system. But now it was giving error for jre1.8.0_73.

在我的系统上,我已经安装,jdk1.8.0_73但它仍然为jre1.8.0_91. 我检查了 jre 更新,发现这是我系统上最新的 JRE。所以,我卸载了,jre1.8.0_91希望它现在可以选择我系统中已安装的 JDK jre。但是现在它为jre1.8.0_73.

I double checked by JDK_HOME,JAVA_HOMEand PATHvariable and all were pointing to jdk1.8.0_73

我一倍检查JDK_HOMEJAVA_HOMEPATH变量,所有的都指向jdk1.8.0_73

Resolution:

Resolution

So to resolve this issue, instead of running the command like

所以要解决这个问题,而不是像这样运行命令

java -jar fmw_12.2.1.1.0_wls.jar, I ran it as

java -jar fmw_12.2.1.1.0_wls.jar,我运行它

"C:\Program Files\Java\jdk1.8.0_73\bin\javaw.exe" -jar fmw_12.2.1.1.0_wls.jar"

"C:\Program Files\Java\jdk1.8.0_73\bin\javaw.exe" -jar fmw_12.2.1.1.0_wls.jar"

and the issue got resolved

问题得到解决

More information about this can be found here

可以在此处找到有关此的更多信息

回答by CodingDeep

It worked for me after I used this line:

在我使用这条线后,它对我有用:

Downloaded fmw_12.2.1.1.0_wls_quick_Disk1_1of1 and extracted to C:\Softwares\OracleFustionMiddleware and then from command prompt

下载 fmw_12.2.1.1.0_wls_quick_Disk1_1of1 并解压到 C:\Softwares\OracleFustionMiddleware 然后从命令提示符

C:\softwares\OracleFusionMiddleware>"C:\Program Files\Java\jdk1.8.0_91\bin\java. exe" -jar fmw_12.2.1.1.0_wls_quick.jar

C:\softwares\OracleFusionMiddleware>"C:\Program Files\Java\jdk1.8.0_91\bin\java.exe"-jar fmw_12.2.1.1.0_wls_quick.jar

回答by Sam2016

i faced the same problem even when JAVA_HOME points to JDK this is how i resolved it ,

即使 JAVA_HOME 指向 JDK,我也遇到了同样的问题,这就是我解决的方法,

  1. run command prompt as administrator

  2. go to the directory which contains your jar file

    C:\Windows\system32>cd/
    
    C:\>cd oracleweblogic
    
  3. Set JAVA_HOME and path again on the command prompt

    //put path in double quotes otherwise it won't recognize variable

    C:\oracleweblogic>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_45"
    
    C:\oracleweblogic>set path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%
    

    If you have already set the JAVA_HOME then in the second step you can also type as: C:\oracleweblogic>set path=%JAVA_HOME%\bin;%path%

  4. run the jar file

    C:\oracleweblogic>java -jar fmw_12.2.1.1.0_wls_quick.jar
    
  1. 以管理员身份运行命令提示符

  2. 转到包含您的 jar 文件的目录

    C:\Windows\system32>cd/
    
    C:\>cd oracleweblogic
    
  3. 在命令提示符下再次设置 JAVA_HOME 和路径

    //将路径放在双引号中,否则将无法识别变量

    C:\oracleweblogic>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_45"
    
    C:\oracleweblogic>set path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%
    

    如果您已经设置了 JAVA_HOME,那么在第二步中您还可以输入: C:\oracleweblogic>set path=%JAVA_HOME%\bin;%path%

  4. 运行jar文件

    C:\oracleweblogic>java -jar fmw_12.2.1.1.0_wls_quick.jar
    

you should see something like this if your setup is correct

如果您的设置正确,您应该会看到类似的内容

C:\oracleweblogic>java -jar fmw_12.2.1.1.0_wls_quick.jar
Launcher log file is C:\Users\ANANT\AppData\Local\Temp\OraInstall2016-10-06_12-4
6-22PM\launcher2016-10-06_12-46-22PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 1696    Passed
Checking swap space: must be greater than 512 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit n
ot required)
Checking temp space: must be greater than 300 MB.   Actual 42253 MB    Passed


Preparing to launch the Oracle Universal Installer from C:\Users\ANANT\AppData\L
ocal\Temp\OraInstall2016-10-06_12-46-22PM
Log: C:\Users\ANANT\AppData\Local\Temp\OraInstall2016-10-06_12-46-22PM\install20
16-10-06_12-46-22PM.log

*****************************************************


Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Develope
r
Distribution Version : 12.2.1.1.0

Oracle Home : C:\oracleweblogic\wls12210
Java Home : C:\Program Files\Java\jdk1.8.0_45

Note: Oracle Home not supplied (defaulted to <present working dir>\wls12210)

*****************************************************

Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of 6.1,6.2,6.3,10.0
Actual Result: 6.3
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.

回答by Manisha Nagpal

I had same problem. I had JAVA_HOMEvariable set to 'C:\Program Files\Java\jdk1.8.0_25' and Pathvariable set to 'C:\Program Files\Java\jdk1.8.0_25\bin'. Even after checking, it was giving me the same error. But then I changed order of the Pathvariable. I set it to "C:\Program Files\Java\jdk1.8.0_25\bin;C:\ProgramData\Oracle\Java\javapath;C:\oraclexe\app\oracle\product\11.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem" keeping path of jdk bin at the first place. It solved the issue.

我有同样的问题。我将JAVA_HOME变量设置为“ C:\Program Files\Java\jdk1.8.0_25”并将Path变量设置为“ C:\Program Files\Java\jdk1.8.0_25\bin”。即使经过检查,它也给了我同样的错误。但后来我改变了Path变量的顺序。我将其设置为“ C:\Program Files\Java\jdk1.8.0_25\bin;C:\ProgramData\Oracle\Java\javapath;C:\oraclex\app\oracle\product\11.2.0\server\bin; %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem" 首先保留 jdk bin 的路径。它解决了这个问题。

回答by T?n Phát Ph?m

Problems

问题

  1. You can't run as admin
  2. You launch command prompt and it confuse the Java home
  3. You've done lots with settings but can't fix it
  1. 你不能以管理员身份运行
  2. 您启动命令提示符,它混淆了 Java 主页
  3. 你已经做了很多设置,但无法修复它

Solutions

解决方案

  1. Uninstall JAVA completely.
  2. Uninstall JAVA again, this time unselect JRE.
  3. Launch command prompt and run the JAR setup file
  1. 彻底卸载JAVA。
  2. 再次卸载JAVA,这次取消选择JRE。
  3. 启动命令提示符并运行 JAR 安装文件

回答by sjha23

For Linux when you download the JDK using http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.

对于 Linux,当您使用http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html下载 JDK 时。

Goto Run > Debug > Debug (Edit configuration) > Default > TestNG > JRE (set up the location where you have downloaded the file)

转到 Run > Debug > Debug (Edit configuration) > Default > TestNG > JRE(设置下载文件的位置)

回答by Srikanth Neerumalla

You can install it by giving the full path:

您可以通过提供完整路径来安装它:

C:\Program Files\Java\jdk1.8.0_131\bin\java" -jar fmw_12.2.1.2.0_wls.jar