Eclipse中Program arguments和VM arguments的说明

在运行程序的时候,咱们通常能够进行run configuration的配置,就好比tomcat源码导入eclipse以后,咱们能够发现其运行配置以下:数组

其中Program arguments配置的元素就是咱们传入main方法的字符串数组,而VM arguments其实就是咱们在程序中须要的运行时环境变量。好比上图中就是指定catalina.home为工程所在的位置。在程序中咱们能够经过 System.getProperties("catalina.home")。须要注意的一点,上面的catalina.home的配置中用到了预置的${project_loc}变量(能够经过下面的Variables按钮进行添加),其实后面的部分能够省略不要,只是用来指定工程中的特定文件。对于${project_loc}的说明eclipse官网的描述以下:tomcat

The absolute path on the system's hard drive to the currently selected resource's project or to the project being built if the external tool is run as part of a build.eclipse

其实就是指的工程所在的绝对路径,好比我运行的这个代码所在的工程在 c:/workspace下,工程的名字为project1。那么此时${project_loc}就应该为:c:/workspace/project1。jsp

具体的其余参数的说明请参照官方文档: http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fconcepts-exttools.htmui

相关文章
相关标签/搜索