[英]The full pathname of a JDK installation for Oracle SQL Developer
I want to run Oracle SQL Devloper
on Ubuntu with this command:我想使用以下命令在 Ubuntu 上运行
Oracle SQL Devloper
:
sh sqldeveloper/sqldeveloper.sh
Then I got this message:然后我收到了这条消息:
Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/aimad/.sqldeveloper/4.0.0/product.conf
输入JDK安装的完整路径名(或Ctrl-C退出),路径将存储在/home/aimad/.sqldeveloper/4.0.0/product.conf
So I gave the path of jdk as the following:所以我给出了jdk的路径如下:
/usr/lib/jvm/java-7-openjdk-i386/
/usr/lib/jvm/java-7-openjdk-i386/
But then I got this message:但后来我收到了这条消息:
Error: Java home /usr/lib/jvm/java-7-openjdk-i386//bin/java is not a JDK.
错误:Java 主页 /usr/lib/jvm/java-7-openjdk-i386//bin/java 不是 JDK。 Running SQL Developer under a JRE is not supported.
不支持在 JRE 下运行 SQL Developer。
For me it was similar error.对我来说,这是类似的错误。 I solved it simply by inserting
我只是通过插入来解决它
SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64/
into ~/.sqldeveloper/4.0.0/product.conf file.进入 ~/.sqldeveloper/4.0.0/product.conf 文件。
I Agree with szabozoltan's answer but there should be some explanation required for this:我同意 szabozoltan 的回答,但对此应该有一些解释:
SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64/
This one we need to keep in product.conf file.这个我们需要保存在 product.conf 文件中。 Inorder to open that file we need to type following command:
为了打开该文件,我们需要键入以下命令:
sudo gedit /home/abc/.sqldeveloper/4.0.0/product.conf
After this, type the following command.在此之后,键入以下命令。
./sqldeveloper.sh
That's it, your SQL Developer will be opened.就是这样,您的 SQL Developer 将被打开。
You only have the Java JRE installed, you need to install the JDK in order for Oracle SQL Devloper to work.您只安装了 Java JRE,您需要安装 JDK 才能让 Oracle SQL Devloper 工作。
TL;DR TL; 博士
Install the JDK, type sudo apt-get install openjdk-7-jdk
in a terminal.安装 JDK,在终端中输入
sudo apt-get install openjdk-7-jdk
。
To check if you have the JDK installed, type aptitude search openjdk-7-jdk
in the terminal.要检查您是否安装了 JDK,请在终端中输入
aptitude search openjdk-7-jdk
。 If you see an i
beside either package then it is installed.如果您在任一软件包旁边看到
i
,则说明它已安装。 For example, I have the 64-bit JDK installed on my machine, this is the output.例如,我的机器上安装了 64 位 JDK,这是输出。
$ aptitude search openjdk-7-jdk
i openjdk-7-jdk - OpenJDK Development Kit (JDK)
p openjdk-7-jdk:i386 - OpenJDK Development Kit (JDK)
If the package does not have an i
beside it, then it is not installed.如果软件包旁边没有
i
,则表示未安装。
To install in the JDK in ubuntu you need to install the package openjdk-7-jdk.要在 ubuntu 中安装 JDK,您需要安装 openjdk-7-jdk 包。 Install by running
sudo apt-get install openjdk-7-jdk
in a terminal.通过在终端中运行
sudo apt-get install openjdk-7-jdk
进行sudo apt-get install openjdk-7-jdk
。
After installing the JDK you need to set the JAVA_HOME environment variable.安装 JDK 后,您需要设置 JAVA_HOME 环境变量。 You can see all the installed JDKs on your machine by running
update-java-alternatives -l
, choose the one you want to use and copy the third field, this field is the JAVA_HOME for that JDK.您可以通过运行
update-java-alternatives -l
来查看机器上所有已安装的 JDK,选择要使用的一个并复制第三个字段,该字段是该 JDK 的 JAVA_HOME。
For example, on my machine例如,在我的机器上
$ update-java-alternatives -l
java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64
This means I only have one JDK installed, java-1.7.0-openjdk-amd64
, and its JAVA_HOME is /usr/lib/jvm/java-1.7.0-openjdk-amd64
.这意味着我只安装了一个 JDK,
java-1.7.0-openjdk-amd64
,它的 JAVA_HOME 是/usr/lib/jvm/java-1.7.0-openjdk-amd64
。
Next, set the JAVA_HOME environment variable, in Bash I would set it by running this from the terminal:接下来,设置 JAVA_HOME 环境变量,在 Bash 中,我将通过从终端运行来设置它:
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
Check to make sure it was set correctly.检查以确保其设置正确。
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-amd64
This will set JAVA_HOME for your current terminal session, to not have to worry about setting it again, you can add it to your ~/.bashrc
file.这将为您当前的终端会话设置 JAVA_HOME,不必担心再次设置它,您可以将其添加到您的
~/.bashrc
文件中。
Once the JDK is installed and the JAVA_HOME environment variable set, you can move into the sql developer directory and run the sqldeveloper.sh script.一旦安装了 JDK 并设置了 JAVA_HOME 环境变量,您就可以进入 sql developer 目录并运行 sqldeveloper.sh 脚本。
$ cd sqldeveloper
$ ./sqldeveloper.sh
If sqldeveloper.sh is not executable run chmod +x sqldeveloper.sh
and run the script again.如果 sqldeveloper.sh 不可执行,请运行
chmod +x sqldeveloper.sh
并再次运行脚本。
For completeness, you can check what Java packages you have installed by running aptitude search openjdk-7
.为了完整
aptitude search openjdk-7
,您可以通过运行aptitude search openjdk-7
来检查您安装了哪些 Java 包。 If you have the JRE installed you will se an i
beside a package that begins with openjdk-7-jre
如果你安装了 JRE,你会在一个以
openjdk-7-jre
开头的包旁边看到一个i
$ aptitude search openjdk-7
p openjdk-7-dbg - Java runtime based on OpenJDK (debugging symbols)
p openjdk-7-dbg:i386 - Java runtime based on OpenJDK (debugging symbols)
p openjdk-7-demo - Java runtime based on OpenJDK (demos and examples)
p openjdk-7-demo:i386 - Java runtime based on OpenJDK (demos and examples)
p openjdk-7-doc - OpenJDK Development Kit (JDK) documentation
i openjdk-7-jdk - OpenJDK Development Kit (JDK)
p openjdk-7-jdk:i386 - OpenJDK Development Kit (JDK)
i openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
p openjdk-7-jre:i386 - OpenJDK Java runtime, using Hotspot JIT
i openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
p openjdk-7-jre-headless:i386 - OpenJDK Java runtime, using Hotspot JIT (headless)
i openjdk-7-jre-lib - OpenJDK Java runtime (architecture independent libraries)
v openjdk-7-jre-lib:i386 -
p openjdk-7-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
p openjdk-7-jre-zero:i386 - Alternative JVM for OpenJDK, using Zero/Shark
p openjdk-7-source - OpenJDK Development Kit (JDK) source files
p uwsgi-plugin-jvm-openjdk-7 - Java plugin for uWSGI (OpenJDK 7)
p uwsgi-plugin-jvm-openjdk-7:i386 - Java plugin for uWSGI (OpenJDK 7)
p uwsgi-plugin-jwsgi-openjdk-7 - JWSGI plugin for uWSGI (OpenJDK 7)
p uwsgi-plugin-jwsgi-openjdk-7:i386 - JWSGI plugin for uWSGI (OpenJDK 7)
Just solved this by not adding slash as you did, so instead of只是通过不添加斜杠来解决这个问题,而不是
/usr/lib/jvm/java-7-openjdk-i386/
/usr/lib/jvm/java-7-openjdk-i386/
type类型
/usr/lib/jvm/java-7-openjdk-i386
/usr/lib/jvm/java-7-openjdk-i386
如果您使用 Oracle 的 JDK,只需键入/usr/java/default
并按 Enter 键。
只需将下面的一个插入 ~/.sqldeveloper/4.0.0/product.conf 文件。
SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64/
I had a similar issue and solved it by simply adding 'SetSkipJ2SDKCheck true' to one of the below files.我遇到了类似的问题,只需将“SetSkipJ2SDKCheck true”添加到以下文件之一即可解决。
/home/abc/.sqldeveloper/4.1.5/product.conf
/opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
在我的情况下(Oracle SQL Developer 4.1.3)它似乎是 Java 版本的问题 - 当我指向Java 8 JDK 而不是 11 时,它立即开始工作。
I've faced with similar issue.我遇到过类似的问题。 Tried published recommendations but unsuccessfully.
尝试了已发布的建议,但未成功。 Possible the reason I'm using
sdkman
to manage java versions, may be something with permissions because of Mac OS.可能是我使用
sdkman
来管理 java 版本的原因,可能是由于 Mac OS 的原因。
For Mac user it is important try manage configuration:对于 Mac 用户,重要的是尝试管理配置:
SetJavaHome {{path to your java}}
in ~/.sqldeveloper/{{sql-dev-version}}/product.confSetJavaHome {{path to your java}}
this step could help if you are using jdk installed by brew following default path.如果您使用 brew 按照默认路径安装的 jdk,则此步骤可能会有所帮助。
If you've installed openjdk with sdkman
path to java will be like ~/.sdkman/candidates/java/{{java-version}}
and this path needs to be mapped on default expectations with aliases.如果你已经安装了 openjdk 和
sdkman
java 路径会像~/.sdkman/candidates/java/{{java-version}}
并且这个路径需要映射到带有别名的默认期望上。
I did not have information about the default path, so it needs to find executable file:我没有关于默认路径的信息,所以它需要找到可执行文件:
error message
);error message
);ps ux | grep sql
ps ux | grep sql
ps ux | grep sql
- it will help you to detect executable file location sqldeveloper.sh
; ps ux | grep sql
- 它将帮助您检测可执行文件位置sqldeveloper.sh
;/usr/libexec/java_home
;/usr/libexec/java_home
获取 java 的块;export JAVA_HOME=$TMP_PATH
and replace path with your path to java home or simply remove line if JAVA_HOME
was specified in OS settings.export JAVA_HOME=$TMP_PATH
行,并用您的 java home 路径替换 path ,或者如果在操作系统设置中指定了JAVA_HOME
则简单地删除行。In newer version I needed to extend the path in在较新的版本中,我需要扩展路径
/Users/{{yourUsername}}/.sqldeveloper/21.2.1/product.conf
SetJavaHome /Library/Java/JavaVirtualMachines/jdk-11.0.13.jdk/Contents/Home
apt-get install openjdk-6-jre
apt-get install openjdk-7-jre
apt-get install openjdk-6-jdk
apt-get install openjdk-7-jdk
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.