zoukankan      html  css  js  c++  java
  • java获取路径

    	public static void main(String[] args) throws MalformedURLException, URISyntaxException {
    		System.out.println("java.home : " + System.getProperty("java.home"));
    		System.out.println("java.class.version : " + System.getProperty("java.class.version"));
    		System.out.println("java.class.path : " + System.getProperty("java.class.path"));
    		System.out.println("java.library.path : " + System.getProperty("java.library.path"));
    		System.out.println("java.io.tmpdir : "  + System.getProperty("java.io.tmpdir"));
    		System.out.println("java.compiler : " + System.getProperty("java.compiler"));
    		System.out.println("java.ext.dirs : " + System.getProperty("java.ext.dirs"));
    		System.out.println("user.name : " + System.getProperty("user.name"));
    		System.out.println("user.home : " + System.getProperty("user.home"));
    		System.out.println("user.dir : " + System.getProperty("user.dir"));
    		System.out.println("======================================");
    		System.out.println("package: " + WordToDatabaseController.class.getPackage().getName());
    		System.out.println("package: " + WordToDatabaseController.class.getPackage().toString());
    		System.out.println("======================================");
    		String packName = WordToDatabaseController.class.getPackage().getName();
    		URI packuri = new URI(packName);
    		System.out.println(packuri.getPath());
    		System.out.println(packName.replaceAll("//.", "/"));
    		System.out.println(System.getProperty("user.dir") + "/" + (WordToDatabaseController.class.getPackage().getName()).replaceAll("//.", "/") + "/");
    	}
    

      

  • 相关阅读:
    addEventListener事件委托
    ES6的解构赋值
    JavaScript 中最​​重要的保留字
    HTML 5 Web 存储
    Node.js 里的 process.nextTick(),简单理解
    实现多层DIV叠加的js事件穿透
    touch事件中的touches、targetTouches和changedTouches详解
    Promise.all( ) 的使用
    js 中的五种迭代方法
    迭代
  • 原文地址:https://www.cnblogs.com/hongwei2085/p/9124147.html
Copyright © 2011-2022 走看看