环境一:
操作系统:Redhat 6
JDK:Sun JDK(Oracle JDK)
现在用的sql-developer4.0.3.16.84,装好JDK(1.7版本,只支持大于1.6小于1.8版本),再装sql-developer,直接点击图标就能启动。
安装JDK:http://blog.csdn.net/silence_ljh/article/details/39024341
环境二(本文环境):
操作系统:Redhat 5
JDK:系统自带JDK(OpenJDK)
1、安装Jre
rpm -ihv jre-6u45-linux-x64-rpm
这里官网下载下来的是.bin文件,直接./jre-6u45-linux-x64-rpm.bin就会得到一个.rpm文件。
默认安装在/usr/java/jre1.6.0_45
如果报错error: can't create transaction lock on /var/lib/rpm/__db.000,这是没有权限,换成root用户。
2、安装sql-developer
rpm -ihv sqldeveloper-3.2.20.09.87-1.noarch.rpm
默认安装在/opt/sqldeveloper
3、启动sql-developer
虽然在程序菜单中有sql-developer的图标,但单击并不能启动,因为没有配置jre的路径。所以,只能用命令行启动。
./sqldeveloper.sh 出现
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
要求输入jre路径
/usr/java/jdk1.6.0_45
报错:
修改/opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf文件/opt/sqldeveloper/sqldeveloper/bin/../../ide/bin/launcher.sh: line 430: /root/.sqldeveloper/jdk: No such file or directory
Error: Java home /usr/lib/jvm/java-1.6.0-openjdk-1.2_b11/jre//bin/java is not a J2SE SDK.
Running SQL Developer under a JRE is not supported.
If the Java VM specified by the SetJavaHome is actually a full J2SDK installation
then add 'SetSkipJ2SDKCheck true' to /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
#vi /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
更改红色,添加蓝色,保存退出
IncludeConfFile ../../ide/bin/ide.conf
SetJavaHome /usr/lib/jvm(如果是Sun JDK 就改成/usr/java/jdk1.6.0_45)
SetSkipJ2SDKCheck true
AddVMOption -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG=true
AddVMOption -Dsun.java2d.ddoffscreen=false 内容来自17jquery
AddVMOption -Dwindows.shell.font.languages=
AddVMOption -XX:MaxPermSize=256M
AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
IncludeConfFile sqldeveloper-nondebug.conf
然后可以通过命令启动,也可以点击程序图标启动。