Specify Java VM to use #1119
Rod-Christensen
started this conversation in
General
Replies: 2 comments
-
Do any of the maintainers pay attention here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Rod-Christensen Currently javaExec is auto resolved from your project classpath. Would you create a feature request for this? Also a PR is welcome. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What we are attempting to accomplish is embedded JNI debugging. We have an engine that is written in C++ that initializes the JNI, executes some Java code on behalf of the C++ side of things. There are callbacks that are utilized from the Java side into the C++ code and the other way as well, so it is a fully integrated JNI implementation.
The Java side is actually a pretty small part of our code that we are running and have a built in Python interpret as well. Setting up the embedded python and enabling debugging on it is very straightforward with the APIs and the implementation of the python debug adapter under VS code.
However, the only way that I can seem to utilize debugging with Java via the JNI is by creating a task, starting our engine and then attaching to it.
I've looked at a PR here that looks like it's pretty old that essentially, I think, does what I am looking for but has never been merged. I have done some research and actually stepped through the process within vscode-java-debug and found where the issue actually lies.
Within configurationProvider.ts:
the code goes out and determines the java.exe to start.
If it can be changed to:
It will allow us to specify the executable java vm to start, which in our case is our engine.
Now, our engine does have to do some argument parsing (like -cp) and send the appropriate options over when we initialize via JNI, but that is really the simple part.
The python debug adapter has something very similar to this using "python": "...path..." in the launch configuration. By adding that if statement in configurationProvider.ts, it would allow us to specify "javaExec": "...path..." in the launch config for Java as well.
Do you have any plans to add this kind of capability or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions