java - 关于绝对路径和相对路径的问题
阿神
阿神 2017-04-17 17:05:17
0
1
338
阿神
阿神

闭关修行中......

reply all(1)
洪涛

Java's Runtime.exec(String command) will inherit the current JVM running environment. Runtime.exec(String command)会继承当前JVM的运行环境。

这个环境主要包含:(1)所有的环境变量,尤其是包括PATH;(2)当前工作目录。

调用其它Java程序,我想一般也会采用java executable.class这个命令,此时java

This environment mainly includes: (1) all environment variables, especially PATH; (2) the current working directory.

To call other Java programs, I think the java executable.class command will generally be used. At this time, the java command is guaranteed to be parsed correctly by environment variables, and the file name is based on the current The working directory can also be located. 🎜 🎜Of course, in actual implementation, there will definitely be many details that still need to be discussed. But in the above situation, I feel that the full path is unnecessary, at least it is not necessary to introduce it at the beginning of writing the script (you can just write the relative path and find out the reason if it doesn't work). 🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!