是否有一个JVM命令行选项更改目录? [英] Is there a JVM command-line option to change directory?

查看:148
本文介绍了是否有一个JVM命令行选项更改目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

总之,我想知道,有没有JVM命令行选项来更改开始工作目录?如果它是重要的,我跑jdk1.6.0_24。

In short, I want to know, is there a JVM command-line option to change the starting working directory? If it's important, I'm running jdk1.6.0_24.

背景:

我使用了一个名为Robolectric工具为Eclipse测试主机PC上的Andr​​oid应用程序,而不仿真。 Robolectric需要一个测试项目创建,但测试本身从Android项目下的测试运行。这是通过从Eclipse中完成的,在设置测试设置运行配置的项目:运行在选定的项目,包或源文件夹中的所有测试

I am using a tool called Robolectric for Eclipse to test Android applications on the host PC without emulation. Robolectric requires a test project be created, but the tests themselves to be run from the Android project under test. This is accomplished by from Eclipse, setting the run configuration to the project under test in the setting: "Run all tests in the selected project, package or source folder."

我想如果可能的话,从JVM命令行选项做到这一点,是因为另一种工具我用, Infinitest 不允许您指定测试的工作目录。它,然而,让你指定JVM命令行选项。

I want to do this from the JVM command line options, if possible, because another tool I use, Infinitest, doesn't allow you to specify the working directory of the tests. It does, however, let you specify JVM command-line options.

解决方法:

直到我找到一个更好的解决办法,一个成功的克鲁格一直到AndroidManifest.xml中和res文件夹从Android项目复制。

Until I find a better workaround, a successful kluge has been to copy the AndroidManifest.xml and res folder from the Android project.

推荐答案

当前工作目录是一个操作系统的概念,而不是一个JVM的,所以你需要找到在该级别的解决方案,比如写一个批处理或shell脚本。

"Current working directory" is an OS concept, not a JVM one, so you'll need to find a solution at that level, such as writing a batch or shell script.

这篇关于是否有一个JVM命令行选项更改目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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