Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想zipTransfer.pl从 Java 的一个函数中运行这个 perl 程序
zipTransfer.pl
private void runZipTransfer() throws IOException { Runtime.getRuntime().exec(new String[] {"C:\\Perl64\\bin", "C:\\Lazy\\zipTransfer.pl"}); }
然而,当运行我的 Java 程序时,什么也没有发生!这里的问题在哪里?
您需要执行 perl 解释器:
Runtime.getRuntime().exec(new String[] {"C:\\Perl64\\bin\\perl.exe", "C:\\Lazy\\zipTransfer.pl"});
尝试:
Runtime.getRuntime().exec(new String[] {"perl", "C:\\Lazy\\zipTransfer.pl"});