Author Topic: Attach to Virtual Machine not working  (Read 215 times)

kwilliams

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Attach to Virtual Machine not working
« on: July 14, 2021, 12:28:47 am »
Hi,

I have a Scala project that I want to debug. When I select Debug -> Attach Debugger -> Attach to Java Virtual Machine, nothing happens. I expected a dialog to ask for remote debugging information like the port.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1527
  • Hero Points: 139
Re: Attach to Virtual Machine not working
« Reply #1 on: July 14, 2021, 02:33:10 pm »
I'm assuming you've got the SBT project you mentioned in another post open.

It should pop up a modal dialog when you select that. And it looks like if there's an error before then, it should pop up a message box.  Very strange.

Can you still type in the editor window after that?  Is there any output in the "Build" tool window?  If you try it again, look in the status bar at the bottom left, is there any message there?

If you're on Linux, what window manager are you using?

kwilliams

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #2 on: July 20, 2021, 09:00:10 pm »
Thanks for responding.

It turns out that I did not have my JDK configured in the SlickEdit project. So now, I get a pop-up that say: "could not find a 'tool.jar' for your configured JDK.".

I am using OpenJDK 11. Searching around, it sounds like OpenJdk may have moved things around a bit. The contents of tools.jar, rt.jar and a couple other have been moved to different jar files.

It sounds like Slickedit would need to update to account for this unless there is some way to tell it to look somewhere else.
« Last Edit: July 20, 2021, 09:11:38 pm by kwilliams »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1527
  • Hero Points: 139
Re: Attach to Virtual Machine not working
« Reply #3 on: July 21, 2021, 01:54:35 pm »
Tools.jar got repackaged for Java 1.9 I think.  The debugger code should account for that, and it works for me on OpenJDK 11.0.11.   I suspect the version comparison, it's got a lot of cases from dealing with the version conventions of different JDK providers over the years, so there may be some corner case it's failing on that I'm not seeing.

What's the output you get for "java --version" on your system?  And if you go into the Tools -> Options dialog, and go to Languages -> Application Languages -> Java -> Compiler Properties, what's in the "Compiler Name" pulldown?

kwilliams

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #4 on: July 21, 2021, 05:07:42 pm »
My Java version is Amazon Corretto-11.0.6 and compiler name is JDK 11.0.6

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1527
  • Hero Points: 139
Re: Attach to Virtual Machine not working
« Reply #5 on: July 21, 2021, 06:31:35 pm »
I can reproduce with JDK as well.  Taking a look at it, it should be hot-fixable.

kwilliams

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #6 on: July 21, 2021, 08:04:16 pm »
Awesome!

thanks for looking into this.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1527
  • Hero Points: 139
Re: Attach to Virtual Machine not working
« Reply #7 on: July 23, 2021, 02:16:58 pm »
The fix for this will be in the next 25.0.2 hotfix.