SQL Developer 4.0 Downloads でOracle SQL Developer 4.0 EA3がダウンロード可能になっている。前バージョンの時(Oracle SQL Developer 4.0のインストールとややハマッた時のメモ - kagamihogeの日記)と同じくハマったので対応方法を残しておく。
起きたこと
Unable to create an instance of the Java Virtual Machine Located at path: C:\Java\jdk1.7.0_40\jre\bin\client\jvm.dll
原因と対策
Oracle SQL Developer 4.0のインストールとややハマッた時のメモ - kagamihogeの日記 の時と同じで、メモリが少ないマシンの場合はおそらくメモリ設定を変更しなければならない。というわけで設定ファイルを変更する。
SQL Developer 4.0のディレクトリ構成では、%SQL_DEVELOPER_ROOT%\sqldeveloper\bin\sqldeveloper.conf が参照され、その一行目に「IncludeConfFile ../../ide/bin/ide.conf」とあり、%SQL_DEVELOPER_ROOT%\ide\bin\ide.conf がそれに該当する。ここの38行目はこうなっている。
Oracle SQL Developer 4.0のインストールとややハマッた時のメモ - kagamihogeの日記 より抜粋
……したのだが起動してくれない。SetJavaHomeをコメントアウトしてもエラーになって起動しない。
%SQL_DEVELOPER_ROOT%\ide\bin\ide.confの先頭部分にはこんな感じのことが書いてある。
# (省略) If options need to be
# modified or added, the user may do so by modifying the custom configuration files
# located in the user's home directory. (省略)
#
# Windows Platforms:
# The location of user/product files are often configured during installation,
# but may be found in:
# %APPDATA%\\ \product.conf
# %APPDATA%\\ \jdev.conf
(省略)
#
# In particular, the directives to set the initial and maximum Java memory
# and the SetJavaHome directive to specify the JDK location can be overridden
# in that file instead of modifying this file.
変更したオプションに関してはユーザーホームディレクトリ下の設定ファイルをいじってくれ、パスはこんな感じ。SetJavaHomeとかJDKのメモリ設定とかはこのユーザー設定ファイルで上書きされます、とかなんとか。じゃあそのパスでファイル作ってやればいいのかな、と思う。
しかし、Application Data\SQL Developer\4.0.0.13.30\product.conf とか Application Data\SQL Developer\4.00001330f\product.conf とか作ってもダメ。product-nameとかproduct-versionとかは、%SQL_DEVELOPER_ROOT%\sqldeveloper\bin\version.properties に書いてある値では無いらしい。
テキトーにぐぐってるとSQL Developerの中の人のtweetが引っかかる。
SQL Developer 4: location of Java home changed for Windows. C:\Users\$USER\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf #FavoriteThis
— Jeff Smith (@thatjeffsmith) 2013, 10月 21
によるとWindows XPでは Application Data\sqldeveloper\1.0.0.0.0\product.conf ということになる。てなわけで、JDKのホームディレクトリとメモリ設定変更する。
SetJavaHome C:\Java\jdk1.7.0_45
AddVMOption -Xmx512m
オマケ
起動しねぇ〜って呟いた結果。
SQL Developer 4 EA 3起動しないなんぞ
— kagamihoge (@kagamihoge) 2013, 11月 8
!?
@kagamihoge what happens when you try? try launching from the bin directory instead
— Jeff Smith (@thatjeffsmith) 2013, 11月 8
» About Jeffによると「I’m currently a Product Manager for Oracle, working on the SQL Developer team」とのこと。軽くビビる。
ただこの時既に解決法分かってたので、大変ビミョーな英語でproduct.confの場所が分かってなかったこと、setjavahomeとvm設定で起動した、ってこととりあえず書いた。
@thatjeffsmith thanks. i don't understand 4's product.conf location. CORRECT is Application Data\sqldeveloper\1.0.0.0.0\product.conf.
— kagamihoge (@kagamihoge) 2013, 11月 8
@thatjeffsmith ...and fix SetJavaHome and AddVMOption, launching OK.thanks follow
— kagamihoge (@kagamihoge) 2013, 11月 8
んで、product.confはjvmのパラメータ指定するとこで、特に重要なのがJDKのホーム。あと4.0の新exeはJDKを自動で探してくれるよ、とのフォロー。
@kagamihoge that defined the java params, most importantly the location of the JDK. New exe auto-finds the JDK.
— Jeff Smith (@thatjeffsmith) 2013, 11月 8
また、複数ユーザで同一マシンを使う場合に設定ファイルを分けたい場合のものっすよね、的コメントも。
@kagamihoge apparently it's for folks who want to have multiple users on a machine with independent settings
— Jeff Smith (@thatjeffsmith) 2013, 11月 8
果たしてどのくらい感謝が伝わってるのか謎だけどStack Overflowとか見てるとthanks a lotって良く見るし、まぁタブンこう書けば感謝の意は伝わるだろう、ってことでこうなった。
@thatjeffsmith i just understood. thanks a lot.
— kagamihoge (@kagamihoge) 2013, 11月 8
もうcoco塾行くしかねぇな。