第二个答案来自:How to get the path of running java program说我可以使用:
System.getProperty("java.class.path")"
所以我试了一下:
class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
System.getproperty("java.class.path");
}
}
但它抛出了我这个错误:
HelloWorld.java:6: error: cannot find symbol
System.getproperty("java.class.path");
^
symbol: method getproperty(String)
location: class System
1 error
有人可以帮助我如何使用以下命令打印类路径:
final File f = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().getPath());
陪伴而非守候
class类班级
按照班级分组查询班级人数少于50的所有信息
一个学校包括:各个班级,班级的班主任,班主任管理的学生,使用java 设计一个内存存储模型来实现易存易取
有3个班级每班4个学生,分别求出各班的平均分,错在哪里了?(用while)
相关分类