hnm
hnm

Reputation: 57

unable to run sqldeveloper on debian

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

Upvotes: 1

Views: 15814

Answers (9)

Alex Martinez
Alex Martinez

Reputation: 21

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

Upvotes: 2

Alex
Alex

Reputation: 1295

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

Upvotes: 1

user3070289
user3070289

Reputation: 1

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

from: SetJavaHome ../../jdk

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

Upvotes: 0

also it can be

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

Upvotes: 2

Nano Taboada
Nano Taboada

Reputation: 4182

You might want to issue the following command:

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

Upvotes: 2

hnm
hnm

Reputation: 57

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

Upvotes: 1

Codo
Codo

Reputation: 78795

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

Upvotes: 0

Mike Baranczak
Mike Baranczak

Reputation: 8374

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

Upvotes: 0

Codo
Codo

Reputation: 78795

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

Upvotes: 1

Related Questions