Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As originally discussed in issue #623 I was looking for a way to start the JVM using a configuration file instead of hardwired / compiled values. I hope that the value of such a capability is obvious, but here are my main reasons for such a feature (I am sure you can find more):
The format is inspired by the Tanuki wrapper, although is not compatible with it (not a goal…).
About the implementation and source file location choice…
** Move the original source code that is responsible for starting the JVM to a separate sub-folder - osv/java/jvm.
This choice makes sense as it creates the necessary logical separation between the JVM startup code (that has remained unchanged) and the (new) wrapper code. It also makes sure that the wrapper is compiled with the exact same settings as the java.so library (this proved to be a crucial issue). Note: nothing else has been changed in the sources or the location of the java.so artifact in the image.
BTW, in this context, even if you decide not to include the wrapper code, IMO this patch is worth applying (another reason why it is a separate commit), as it makes the source folders structure clearer – each functionality has its own folder (e.g., jni, balloon, etc.) – regardless of the language the source code is written.
** Create a new javawrapper module whose source resides under osv/java/wrapper
This includes adding a run_java_wrapper class/capability in the osv/scripts/module/api.py file, which means that users can simply do:
Note: make sure you map correctly the configuration file to the declared location in the usr.manifest file
Which compared to the previous situation is an improvement (IMO) – see below:
All the “ugly” stuff is now in the configuration file and it can be easily edited…