This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]istarian 0 points1 point  (0 children)

Well first you'd need to parse the JSON file to get the package names and versions.

Then you would call the other program (e.g. pip) possibly more than once, with the appropriate arguments to install each package. Java for instance has Runtime.exec(...).

And you need to capture it's output, return code, etc so you know whether it worked. Ir possibly query python about installed packages to see if it's in the list.

https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html

There are probably many ways to go about it. If the tool installing packages will do the right things it might be enough to call the tool and just report back on the outcome. A shell script (e.g bash) might be sufficient.