0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java9以降のリモートデバッグ方法について

Last updated at Posted at 2020-06-17

jdkのバージョンが9になったときに eclipse からサーバにリモートでデバッグする際のオプションの内容が変更になった

  • 情報元ページ >> Notes and Changes
    具体的には以下の address オプションの指定方法が変更になった

1.バッチのリモートデバッグの場合

  • Java オプション
    • 変更前
      "-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"
    • 変更後
      "-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:8000,server=y,suspend=y"

- シェルの中身(オプション設定部分一部抜粋)
DEBUG="-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:8000,server=y,suspend=y"
$JAVA $JAVAOPT $DEBUG $CONTROLLER $APPCONF $WEBINF $APL $SERIAL_NO >> ${LOG} 2>> ${LOG}

2.オンラインのリモートデバッグの場合

  • 起動方法
  • 変更前
    /usr/java/tomcat/bin/catalina.sh jpda start
  • 変更後
    JPDA_ADDRESS=0.0.0.0:8000 /usr/java/tomcat/bin/catalina.sh jpda start
  • 停止方法(変わらず)
    /usr/java/tomcat/bin/catalina.sh jpda stop

ローカルでバッチを実行する際に以下のエラーが出た場合

  • JRE Oracle Corporation/11.0.1 is not supported, advanced source lookup disabled: Unsupported class file major version 55.

実行時に必要な jar を依存関係に追加することで解決
2019-01-30_11h59_02.jpg 

jarファイルの実行

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=0.0.0.0:8000,suspend=y -jar

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?