The full pathname of a JDK installation for Oracle SQL Developer

旧城冷巷雨未停 提交于 2019-12-31 10:46:07

问题


I want to run Oracle SQL Devloper on Ubuntu with this command:

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

So I gave the path of jdk as the following:

/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. Running SQL Developer under a JRE is not supported.


回答1:


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.




回答2:


I Agree with szabozoltan's answer but there should be some explanation required for this:

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

This one we need to keep in product.conf file. Ino rder 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.




回答3:


You only have the Java JRE installed, you need to install the JDK in order for Oracle SQL Devloper to work.

TL;DR

Install the JDK, type sudo apt-get install openjdk-7-jdk in a terminal.

Checking if JDK is Installed

To check if you have the JDK installed, type aptitude search openjdk-7-jdk in the terminal. If you see an i beside either package then it is installed. For example, I have the 64-bit JDK installed on my machine, this is the output.

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

Installing JDK

To install in the JDK in ubuntu you need to install the package openjdk-7-jdk. Install by running sudo apt-get install openjdk-7-jdk in a terminal.

Setting JAVA_HOME

After installing the JDK you need to set the JAVA_HOME environment variable. 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.

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.

Next, set the JAVA_HOME environment variable, in Bash I would set it by running this from the terminal:

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

Running Oracle SQL Developer

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.

$ cd sqldeveloper
$ ./sqldeveloper.sh

If sqldeveloper.sh is not executable run chmod +x sqldeveloper.sh and run the script again.

Checking all Java packages

For completeness, you can check what Java packages you have installed by running aptitude search openjdk-7. If you have the JRE installed you will se an i beside a package that begins with openjdk-7-jre

$ 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) 



回答4:


Just solved this by not adding slash as you did, so instead of

/usr/lib/jvm/java-7-openjdk-i386/

type

/usr/lib/jvm/java-7-openjdk-i386




回答5:


Just insert below one into ~/.sqldeveloper/4.0.0/product.conf file.

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



回答6:


Just type /usr/java/default and hit Enter if you use Oracle's JDK.




回答7:


I had a similar issue and solved it by simply adding 'SetSkipJ2SDKCheck true' to one of the below files.

/home/abc/.sqldeveloper/4.1.5/product.conf
/opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf



回答8:


In my case (Oracle SQL Developer 4.1.3) it seems to be problem with Java version - when I point to Java 8 JDK instead of 11, it started working immediately.




回答9:


 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 


来源:https://stackoverflow.com/questions/22158923/the-full-pathname-of-a-jdk-installation-for-oracle-sql-developer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!