请看,得到目录的问题,请高手指教,在线等 public class d{ public static void main(String str[]){ String dir=System.getProperty("user.dir"); System.out.println(dir); } } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是指class d的加载路径吗?Class cls = d.getClass();ProtectionDomain domain = cls.getProtectionDomain();CodeSource cs = domain.getCodeSource();URL loc = cs.getLocation();File dir= new File(loc.getPath());如果是"user.dir"的路径File dir = new File(System.getProperty("user.dir")); String dir=System.getProperty("user.dir"); 基本数据类型转换的几个小问题 关于Java中的类、方法相互调用的问题 小狗来回跑的问题 关于接口用static来修饰表示什么呢 jsp 里面 播放 mpg 问题,第一次打开的时候 速度非常的慢,第2次就不会,怎么回事情 如何读入一个gif文件,然后把他转成Image类型 EditPlus的使用者come in 哪里有ECLIPSE的API文档,我只在网上早到在线的,我需要可以下载的 菜鸟问题之 学java 要怎么建环境,我下载安装了jdk却不行?在线等待! 为什么找不到yu.class 各位好,我是初学者,我有一个很困惑的问题,请帮忙解决一下好吗? 怎样设置打开文件对话框的过滤器
Class cls = d.getClass();
ProtectionDomain domain = cls.getProtectionDomain();
CodeSource cs = domain.getCodeSource();
URL loc = cs.getLocation();
File dir= new File(loc.getPath());如果是"user.dir"的路径File dir = new File(System.getProperty("user.dir"));