概要
Eclipse 3.3.2 を新たにインストールし、Software Update 機能を使って TPTP プラグインをインストールしたところ、プロファイリング機能が動作しなかった。原因は、ダウンロードしたプラグインの中に Agent Controller (acserver.exe) など一式が含まれていないこと。
例えば、次のディレクトリが存在しない。
C:\usr\eclipse\plugins\
org.eclipse.tptp.platform.ac.win_ia32_4.4.1.v200802050100\
agent_controller
org.eclipse.core.runtime.CoreException The process launcher seems to be inactive. Restart the Agent Controller and try again. org.eclipse.core.runtime.CoreException: The process launcher seems to be inactive. Restart the Agent Controller and try again. at org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility.createCoreException(LauncherUtility.java:123) at org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility.createCoreException(LauncherUtility.java:131) at org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIDelegateHelper.handleError(TIDelegateHelper.java:597) at org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIDelegateHelper.launchProcess(TIDelegateHelper.java:509) at org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIDelegateHelper.launch(TIDelegateHelper.java:313) at org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIJavaLauncherDelegate.launch(TIJavaLauncherDelegate.java:37) at org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility.delegateInit(LauncherUtility.java:1163) at org.eclipse.tptp.trace.ui.provisional.launcher.PrimaryLaunchDelegate.run(PrimaryLaunchDelegate.java:196) at java.lang.Thread.run(Unknown Source)
次の手順で Java プロファイリング環境を構築できた。
ゼロから環境を構築する
次の手順で、ゼロから環境を構築できる。Eclipse 本体をダウンロード、インストール
http://www.eclipse.org/downloads/ にアクセスし、「Eclipse IDE for Java EE Developers 」のところの Windows をクリックする。そして 「Download from: ...」をクリックして
eclipse-jee-europa-winter-win32.zip をダウンロードする。この zip を展開し、eclipse フォルダを適当な場所に置く。
以降では
c:\usr\eclipse に置いたと仮定して話を進める。TPTPプラグインをダウンロード
Eclipse TPTP のページにアクセスし、右側の Download をクリックする。そして、「TPTP Plugins for Eclipse」と書かれているところから、次のプラグインの zip ファイルをダウンロードする。

- Platform
- Monitoring Tools
- Tracing and Profiling Tools
- Testing Tools ※これは無くても動作するかも
C:\usr\eclipse に重ねて展開する。これで TPTP が利用可能になる。
トラブルシューティング
eclipse フォルダの名前を変えると動作しない
C:\usr\eclipse を C:\usr\eclipse-tptp のように名前を変えると、動作しなかった。Preference に設定箇所があるのかもしれないが、見つけることができなかった。
日本語Eclipse Pleiades All in One で TPTPを使う
日本語Eclipse Pleiades All in One 日本語化や便利なプラグインが最初から含まれている便利なディストリビューション。この eclipse で TPTP を使うには、次の手順を実行する。
Ultimate をインストール
上記 Web サイトにアクセスし、「Ultimate (JREなし)」をインストールする。それを
C:\usr\eclipse に展開する。なお、4/3 にダウンロードした 3.3.2 版では TPTP は動作したが、以前にダウンロードした 3.3.1.1 版では動作しなかった。
TPTP プラグインをインストール
「ソフトウェア更新」機能を使ってインストールせず、さきほどと同じように Eclipse TPTP プロジェクトページから次のファイルをダウンロードし、インストールする。- tptp.monitoring.runtime-TPTP-4.4.1.zip
- tptp.platform.runtime-TPTP-4.4.1.zip
- tptp.trace.runtime-TPTP-4.4.1.zip
clean 実行
C:\usr\eclipse\ ディレクトリの中にある eclipse.exe -clean.cmd を実行する。これで、TPTP が利用できるようになる。
TPTP でプログラム実行時間を計測するテスト
TPTP 実行環境を構築できたら、早速テストを行う。テストプログラム作成
次のようなテストプログラムTest.java を作成する。プロファイル実行
- [実行] メニュー → [プロファイル] → [Java アプリケーション] を実行する。
- ダイアログ上で 「実行時間分析」 を選択し、[OK] ボタンを押す。

- 実行完了後、左側のペイン上の「実行時間分析」をダブルクリックすると、実行時間が表示される。

コメントする