0

I want to debug my web app. In Eclipse IDE for Enterprise Java Developers Version 2019-03(4.11.0), I right-click on my web project and select Debug As->Debug on Server. I choose an existing server then click Finish. A dialog appears and I choose the Switch mode option and click on OK. Then I get a dialog that asks for a remote debugging port with some instructions. It says:

Please note: to connect to remote debugger, the debug port will be opened for TCP ingress on your EC2 security group.

What else would I need to do? I've never done this before?

daniel
  • 1,446
  • 3
  • 29
  • 65
  • Why not just debug locally? – markwalker_ Jan 31 '20 at 11:24
  • @markwalker_ I’m running into other issues debugging locally. I can’t even run my web app locally. I was able to at least run my web app remotely. – daniel Jan 31 '20 at 11:30
  • If you can't run it locally why did you even push it remotely? I can't imagine maintaining a system that wouldn't run locally. You can't assume something will run if you can't run it locally. And you can't really connect to the AWS server from your IDE safely. – markwalker_ Jan 31 '20 at 11:32
  • The local tomcat server won’t start. I’ll be posting a question on Stack Overflow for that issue later. I had gotten it started at one time, but I left off and just recently started on the project again. – daniel Jan 31 '20 at 11:51

1 Answers1

1

If your JVM is running on EC2 on AWS; it would be debugging just like u would do locally.. Only difference is that it will be slower ( because it on cloud ) and debugging port should be open on SecurityGroup of EC2.

Hence on EC2; while starting java; use these options as mentioned on What are Java command line options to set to allow JVM to be remotely debugged?

When you start in debug mode through Eclipse; it automatically gives those options.

You might be using tomcat; hence u would have to give those options in JAVA_OPTS

Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98
  • I'm totally new to this. I don't do anything to start java on EC2, hence I don't know where to put those command line options. I am using tomcat, and I don't know where to put the JAVA_OPTS options. – daniel Jan 31 '20 at 15:46
  • 1
    @DanielBrower https://stackoverflow.com/questions/16689274/how-to-start-debug-mode-from-command-prompt-for-apache-tomcat-server – Deepak Singhal Feb 01 '20 at 06:29