I am writing a little tool that needs to invoke a Perl script to do some stuff.
I already know and written the code on how to call it, but I have to provide the full-qualified path to the Perl script for the exec()
.
Is there any possibility to provide that script as a sort of package that can be invoked directly?
I want to generate an executable JAR later and want to also have the whole tool to provide the Perl script and not to know where it is located.
Currently its like:
private void extractAudioStream() {
inputFile = "C:\\Users\\Stefan\\Documents\\temp_tshark\\forward_stream.pcap";
outputFile_audiostream = "C:\\Users\\Stefan\\Documents\\temp_tshark\\forward_stream.pcm";
String perl_cmd = "perl C:\\Users\\Stefan\\Documents\\tshark_bin\\rtp_dump.pl " + inputFile + " " + outputFile_audiostream;
try {
p = Runtime.getRuntime().exec(perl_cmd);
Hope question is clear enough.
I think this may not be as easy because the system perl
command awaits the
full-qualified path? Is there then any possibility to detect my
current location and pass it to my cmd-String?