Java Oracle SqlDeveloper JDK 路径

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

Oracle SqlDeveloper JDK path

javaoracle11goracle-sqldeveloper

提问by michael

I have recently installed sqldeveloper but i'm getting the below warning window when I try to launch it. This is causing the sqldeveloper to run very very slow and it hangs frequently

我最近安装了 sqldeveloper,但是当我尝试启动它时出现以下警告窗口。这导致 sqldeveloper 运行非常缓慢并且经常挂起

enter image description here

在此处输入图片说明

I have tried editing the file sqldeveloper.cong as suggested in the window above but does not work

我已经尝试按照上面窗口中的建议编辑文件 sqldeveloper.cong 但不起作用

Original

原来的

SetJavaHome ../../jdk

设置JavaHome ../../jdk

Update 1

更新 1

SetJavaHome C:\Program Files\Java\jdk1.7.0_60\bin\ and all other variations but still getting the above warning window

SetJavaHome C:\Program Files\Java\jdk1.7.0_60\bin\ 和所有其他变体,但仍然得到上述警告窗口

Update 2 SetJavaHome C:\Program Files (x86)\Java\jre7\bin and all other variations

更新 2 SetJavaHome C:\Program Files (x86)\Java\jre7\bin 和所有其他变体

Please suggest the correct way

请提出正确的方法

回答by Alex Poole

The message seems to be out of date. In version 4 that setting exists in two files, and you need to change it in the other one, which is:

该消息似乎已过时。在版本 4 中,该设置存在于两个文件中,您需要在另一个文件中更改它,即:

%APPDATA%\sqldeveloper.0.0.0.0\product.conf

Which you might need to expand to your actual APPDATA, which will be something like C:\Users\cprasad\AppData\Roaming. In that file you will see the SetJavaHomeis currently going to be set to the path to your Java 1.8 location, so change that as you did in the sqldeveloper.conf:

您可能需要将其扩展到您的实际APPDATA,这将类似于C:\Users\cprasad\AppData\Roaming. 在该文件中,您将看到SetJavaHome当前将被设置为您的 Java 1.8 位置的路径,因此请按照您在以下文件中所做的更改sqldeveloper.conf

SetJavaHome C:\Program Files\Java\jdk1.7.0_60\bin\

If the settig is blank (in both files, I think) then it should prompt you to pick the JDK location when you launch it, if you prefer.

如果 settig 为空白(我认为在两个文件中),那么它应该会提示您在启动它时选择 JDK 位置,如果您愿意的话。

回答by Mister

In your SQL Developer Bin Folder find

在您的 SQL Developer Bin 文件夹中找到

\sqldeveloper\bin\sqldeveloper.conf

It should be

它应该是

SetJavaHome \path\to\jdk

You said it was ../../jdkoriginally so you could ultimatey do 1 of two things:

你说它../../jdk最初是这样你最终可以做两件事之一:

SetJavaHome C:\Program Files\Java\jdk1.7.0_60

This is assuming that you have JDK 1.7.60 installed in that directory; you don't want to point it to the binfolder you want the whole JDK folder.

这假设您在该目录中安装了 JDK 1.7.60;您不想将其指向bin您想要整个 JDK 文件夹的文件夹。

OR

或者

The second thing you can do is find the jdkfolder in the sqldeveloper folder for me its sqldeveloper\jdkand copy and paste the contents from C:\Program Files\Java\jdk1.7.0_60. You then have to revert your change to read

您可以做的第二件事是jdk为我在 sqldeveloper 文件夹中找到该文件夹,sqldeveloper\jdk然后从C:\Program Files\Java\jdk1.7.0_60. 然后,您必须恢复更改才能阅读

SetJavaHome ../../jdk

in your sqldeveloper.conf

在你的 sqldeveloper.conf

If all else fails you can always redownload the sqldeveloper that already contains the jdk7 all zipped up and ready for you to run at will: Download SQL DeveloperThe file I talk about is called Windows 64-bit - zip file includes the JDK 7

如果所有其他方法都失败了,您可以随时重新下载已经包含 jdk7 的 sqldeveloper 全部压缩并准备好让您随意运行:下载 SQL Developer我谈论的文件称为Windows 64-bit - zip file includes the JDK 7

回答by Milos

another thing you could try is to rename your oldjdk folder, lets say its:

您可以尝试的另一件事是重命名旧的jdk 文件夹,让我们说:

C:\Program Files\Java\jdk1.7.0_04

C:\Program Files\Java\jdk1.7.0_04

change it to saomething like:

将其更改为类似:

C:\Program Files\Java\xxxjdk1.7.0_04

C:\Program Files\Java\xxxjdk1.7.0_04

Now, you should once again asked to set your jdk folder location on Oracle SqlDeveloper launch, and you can chose the right path.

现在,您应该再次要求在 Oracle SqlDeveloper 启动时设置您的 jdk 文件夹位置,您可以选择正确的路径。

Not the most elegant solution, but it worked for me.

不是最优雅的解决方案,但它对我有用。

Milos

米洛斯

回答by Paulo Pedroso

For those who use Mac, edit this file:

对于那些使用 Mac 的人,请编辑此文件:

/Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh

Mine had:

我的有:

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`

and I changed it to 1.8 and it stopped complaining about java version.

我把它改成了 1.8,它不再抱怨 Java 版本了。

回答by Saurav K Singh

On Windows,Close all the SQL Developer windows. Then You need to completely delete the SQL Developerand sqldeveloperfolders located in user/AppData/Roaming. Finally, run the program, you will be prompted for new JDK.

在 Windows 上,关闭所有 SQL Developer 窗口。然后您需要完全删除位于 user/AppData/Roaming的SQL Developersqldeveloper文件夹。最后,运行程序,会提示新的JDK。

Note that AppData is a hidden folder.

请注意,AppData 是一个隐藏文件夹。

回答by George Smith

I cannot believe Oracle's documentation is SO LAME! In some documents it is misleading people to point to the JDK by specifying the path to the JDK root, e.g. on a Mac:

我不敢相信 Oracle 的文档是如此蹩脚!在某些文档中,通过指定 JDK 根目录的路径来误导人们指向 JDK,例如在 Mac 上:

/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/

Reviewing /Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh revealed the method they use to set up the path:

查看 /Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh 揭示了他们用来设置路径的方法:

TMP_PATH=/usr/libexec/java_home -F -v 9if [ -z "$TMP_PATH" ] ; then TMP_PATH=/usr/libexec/java_home -F -v 1.8if [ -z "$TMP_PATH" ] ; then osascript -e 'tell app "System Events" to display dialog "SQL Developer requires a minimum of Java 8. \nJava 8 can be downloaded from:\n http://www.oracle.com/technetwork/java/javase/downloads/"' exit 1 fi fi

TMP_PATH=/usr/libexec/java_home -F -v 9 if [ -z "$TMP_PATH" ] ; then TMP_PATH=/usr/libexec/java_home -F -v 1.8if [ -z "$TMP_PATH" ] ; then osascript -e 'tell app "System Events" to display dialog "SQL Developer requires a minimum of Java 8. \nJava 8 can be downloaded from:\n http://www.oracle.com/technetwork/java/javase/downloads/"' exit 1 fi fi

Executing this manually from Terminal:

从终端手动执行:

/usr/libexec/java_home -F -v 1.8

/usr/libexec/java_home -F -v 1.8

Lists the path as:

列出路径为:

/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home

And this is what you need to specify as the value for

这就是您需要指定的值

SetJavaHome /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home

SetJavaHome /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home

Thank you Oracle for wasting half a day on your "product" that does NOT even support your latest Java version, also released by you.

感谢 Oracle 在您的“产品”上浪费了半天时间,该产品甚至不支持您发布的最新 Java 版本。

回答by u10467351

if you use sqldeveloper 18.2.0

如果您使用 sqldeveloper 18.2.0

edit %APPDATA%\sqldeveloper.2.0\product.conf

jdk9, jdk10, and jdk11 are not supported

不支持 jdk9、jdk10 和 jdk11

change back to jdk 8

改回jdk 8

for example

例如

SetJavaHome C:\Program Files\ojdkbuild\java-1.8.0-openjdk-1.8.0.191-1