你能从java命令行设置当前运行目录吗? [英] Can you set the current running directory from the java command line?

查看:515
本文介绍了你能从java命令行设置当前运行目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从命令行运行Java应用程序。我可以指定一个命令行参数来将当前运行目录设置为除应用程序实际运行位置之外的其他位置吗?

I am running a Java application from the command line. Can I specify a command line argument to set the current running directory to something other than where the application is actually going to run?

推荐答案

有一个JVM参数 -Duser.dir ,可用于设置JVM的工作目录。

There is a JVM argument -Duser.dir which can be used to set working directory for JVM.

这篇关于你能从java命令行设置当前运行目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆