eclipse中的System.getProperty("user.dir")
1、在Java Application中,上述中的获取的是Java项目的路径
(1)运行源码
/**
*
*/
package com.you.test;
/**
* @author YouHaiDong
*
*/
public class Property
{
/**
* @param args
*/
public static void main(String[] args)
{
String path = System.getProperty("user.dir");
System.out.println("Java Application项目路径:" + path);
}
}
项目路径:E:\Eclipse\workspace\You
eclipse中的System.getProperty("user.dir")
原文地址:http://blog.csdn.net/you23hai45/article/details/43202269