Regression: Expressions broken for Remote Java Application in recent Eclipse versions [message #1863418] |
Thu, 01 February 2024 10:13 |
Ben Unger Messages: 1 Registered: February 2024 |
Junior Member |
|
|
We have a command-line build process for our framework, not using Eclipse that generates several JARs that get deployed via Embedded Tomcat. In earlier Eclipse versions (circa 2017), I was able to create an Eclipse project, remove the "src" directory and replace it with a link to our app's source (outside the Eclipse project), and then attach to the running external Java app using a Remote Java Application launcher in Eclipse.
I also added the output JARs from the build to the project, and all the 3rd party JARs used by the app.
With all of this in place, I could set breakpoints, step line-by-line, and most importantly, evaluate expressions in the expression pane.
However, with the most recent versions of Eclipse (2023-09 and 2023-12 tested), expressions don't work. This is horrific! Having to rebuild with logging or print commands makes things much more difficult. Expressions added show no output, and I believe this is connected to what happens when I press ctrl+shift+I after selecting a variable in the code near the breakpoint, which reports,
java.lang.reflect.InvocationTargetException: Unable to evaluate the selected expression:
To perform an evaluation, an expression must be compiled in the context of a Java project's build path. The current execution context is not associated with a Java project in the workspace.
at org.eclipse.jdt.internal.debug.ui.actions.EvaluateAction$1.run(EvaluateAction.java:270)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
The Java project for the new Eclipses was built in the same way, with the src directory in the project linked to the external Java source. All the fixes for this problem on the web say to make sure that you're linking to the same source and libraries in the project, but as mentioned the app wasn't built with an Eclipse project in my case, as it's an external app. So this is not possible as a solution.
Am I stuck using Eclipse from 2017 or switching to IntelliJ? Why would the devs have made such a mind-boggling change that breaks an important feature? Is my take on this correct and if so would filing a bug have a chance of getting this fixed?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds