oracle 无法在 debian 上运行 sqldeveloper
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3443241/
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
unable to run sqldeveloper on debian
提问by hnm
I have installed jdk1.6.0_21 and sqldeveloper(using alien) on debian(lenny). Now when I run sqldeveloper it asks for J2SE installation path, after I type the jdk path it exits with the below error message.
我已经在 debian(lenny) 上安装了 jdk1.6.0_21 和 sqldeveloper(使用外星人)。现在,当我运行 sqldeveloper 时,它会询问 J2SE 安装路径,在我输入 jdk 路径后,它会退出并显示以下错误消息。
Oracle SQL Developer
Copyright (c) 2008, Oracle. All rights reserved.
Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk
/usr/java/jdk1.6.0_21
/opt/sqldeveloper/sqldeveloper/bin/../../ide/bin/launcher.sh: line 430: /root/.sqldeveloper/jdk: No such file or directory
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Error: SQL Developer can't recognize the JDK version
采纳答案by Codo
There are several possible causes for this error message:
此错误消息有多种可能的原因:
- The VM can't find the rt.jar file
- The VM and the rt.jar file don't match (e.g. VM is version 1.6.x, rt.jar is version 1.4)
- The JDK wasn't installed properly
- VM 找不到 rt.jar 文件
- VM 和 rt.jar 文件不匹配(例如 VM 是 1.6.x 版,rt.jar 是 1.4 版)
- JDK 安装不正确
What's the output of the following commands?
以下命令的输出是什么?
which java
java -version
/usr/java/jdk1.6.0_21/bin/java -version
回答by Nano Taboada
You might want to issue the following command:
您可能想要发出以下命令:
echo '/usr/lib/jvm/java-6-sun' > ~/.sqldeveloper/jdk
回答by Luká? Janá?ek
also it can be
也可以
/usr/lib/jvm/java-6-openjdk
回答by Alex Martinez
on the sqldeveloper home there is a file named sqldeveloper.sh (or datamodeler.sh) add the folowin line:
在 sqldeveloper 主页上有一个名为 sqldeveloper.sh(或 datamodeler.sh)的文件,添加以下行:
unset GNOME_DESKTOP_SESSION_ID
should be look like this:
应该是这样的:
#!/bin/bash
unset GNOME_DESKTOP_SESSION_ID
cd "`dirname chown youruser:yourgroup -R ~/.sqldeveloper
`"/sqldeveloper/bin && bash sqldeveloper $*
That's all. Adios
就这样。阿迪奥斯
回答by hnm
Finally I found the problem, JDK was not installed properly. I installed a fresh copy of OpenJDK after that it is working fine.
终于找到问题了,JDK没有安装好。之后我安装了一个新的 OpenJDK 副本,它工作正常。
回答by Alex
I've got the same when i will install my SQL Developer as root, but use it as other user.. In my case looks like the Sql developer was makes file ~/.sqldeveloper/.... as root:root privilegies, but in home dir with sudo user.. It's strange but easy to fix as
当我将我的 SQL Developer 安装为 root 时,我得到了相同的结果,但将它用作其他用户.. 在我的情况下,看起来 Sql 开发人员正在制作文件 ~/.sqldeveloper/.... 作为 root:root 特权,但是在 sudo 用户的家庭目录中.. 这很奇怪但很容易修复
/root/.sqldeveloper/jdk: No such file or directory
回答by Mike Baranczak
When you get several error messages that don't seem to make any sense, start by looking at the firsterror. In this case, that would be:
当您收到几条似乎没有任何意义的错误消息时,请先查看第一个错误。在这种情况下,这将是:
##代码##It looks like sqldeveloper is trying to write the file, and failing. Are you running this as root? If not, can you think of any reason why sqldeveloper would think that your home directory is /root/?
看起来 sqldeveloper 正在尝试写入文件,但失败了。您是否以 root 身份运行它?如果没有,您能想到 sqldeveloper 认为您的主目录是 /root/ 的任何原因吗?
回答by Codo
It looks as if the two java versions (OpenJDK accessible via /usr/bin/java and JDK 1.6.0_21 get mixed up). I can only guess how it can be solved:
看起来两个 Java 版本(可通过 /usr/bin/java 和 JDK 1.6.0_21 访问的 OpenJDK 混淆了)。我只能猜测如何解决:
- run
update-alternatives --set java /usr/java/jdk1.6.0_21/bin/java
- try to uninstall OpenJDK
- possibly, you need to do both
- 跑
update-alternatives --set java /usr/java/jdk1.6.0_21/bin/java
- 尝试卸载 OpenJDK
- 可能,你需要同时做
回答by user3070289
Only replace in /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
只在/opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf中替换
from: SetJavaHome ../../jdk
来自:SetJavaHome ../../jdk
to: SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64
到:SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64