Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to debug a jar that runs called by a shell (.sh) opened by SSH?

 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My application is packet in a jar (with a main method) that runs called by a shell file (.sh). I access the server folder through SSH.

I'd like to know if there's a way to debug my application in Eclipse.

I put the following options in the sh file
-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Also changed Eclipse, creating Remote Java Application entrance in Debug Configurations but it didn't work... does anyone know what to do?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18026
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to tell the JVM remote debugger what machine the JVM being debugged is on. Looks like you didn't do that.

You may also need a hole punched in the remote machine's firewall(s) in order to access that port. Or an ssh tunnel if that's not possible (and it probably shouldn't be, for security reasons!).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic