jdk4py icon indicating copy to clipboard operation
jdk4py copied to clipboard

export java, jmap, keytool ... in in bin

Open ZeeD opened this issue 1 year ago • 0 comments

currently if you install jdk4py you will have a copy of the jdk in ${VENV}/lib/python3.12/site-packages/jdk4py/java-runtime the java runtime offers some command line tool, in .../java-runtime/bin, such as java, keytool, etc. At the moment I see:

$ ls .venv/lib/python3.12/site-packages/jdk4py/java-runtime/bin/ -1
java
jcmd
jfr
jinfo
jmap
jps
jrunscript
jstack
jstat
jwebserver
keytool
rmiregistry
$ 

I think it would be useful to package some alias to these binaries as executable scripts. As described on https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts it would be possible to add a section like

[project.scripts]
spam-cli = "spam:main_cli"

to provide these scripts in the .venv/bin folder, once the package is installed

my understanding is that you cannot directly link an executable, but it would not be too difficult to write a python module that exposes a java, jcmd, ... functions that wraps the required commands.

ZeeD avatar Nov 26 '24 15:11 ZeeD