开发者

unable to run sqldeveloper on debian

开发者 https://www.devze.com 2023-01-11 07:12 出处:网络
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 mes

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.

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/../..开发者_StackOverflow/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


You might want to issue the following command:

echo '/usr/lib/jvm/java-6-sun' > ~/.sqldeveloper/jdk


also it can be

/usr/lib/jvm/java-6-openjdk


on the sqldeveloper home there is a file named sqldeveloper.sh (or datamodeler.sh) add the folowin line:

unset GNOME_DESKTOP_SESSION_ID

should be look like this:

#!/bin/bash
unset GNOME_DESKTOP_SESSION_ID
cd "`dirname $0`"/sqldeveloper/bin && bash sqldeveloper $*

That's all. Adios


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

What's the output of the following commands?

which java
java -version
/usr/java/jdk1.6.0_21/bin/java -version


Finally I found the problem, JDK was not installed properly. I installed a fresh copy of OpenJDK after that it is working fine.


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

 chown youruser:yourgroup -R ~/.sqldeveloper


When you get several error messages that don't seem to make any sense, start by looking at the first error. In this case, that would be:

/root/.sqldeveloper/jdk: No such file or directory

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/?


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:

  • run update-alternatives --set java /usr/java/jdk1.6.0_21/bin/java
  • try to uninstall OpenJDK
  • possibly, you need to do both


Only replace in /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf

from: SetJavaHome ../../jdk

to: SetJavaHome /usr/lib/jvm/java-7-openjdk-amd64

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号