I'm trying to develop a website that takes user input and converts to a text file. The text file is then used as an input for a .jar
file. (e.g. java -jar encoder.jar -i text.txt
), the jar then outputs a .bin
file for the user to download.
This jar is designed to be run from command line and I really don't know the best way to implement it within a .jsp
page. I have created a few java test classes but nothing has worked so far.
Does anyone have any suggestions on possible methods?
An alternative to running it as an external process is to invoke its main class in the current JVM:
META-INF/MANIFEST.MF
of the jarMain-Class:
. Say it is called EncoderMainClass
main
method: EncoderMainClass.main("-i", "text.txt")
This aught to be faster because a new OS process does not need to be created, but there may be security considerations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With