zoukankan      html  css  js  c++  java
  • 查看JVM中三种类加载器各自的加载目录

     1 import java.util.Arrays;
     2 import java.util.List;
     3 
     4 /**
     5  * 3种类加载器的加载目录
     6  * @ author:xxx
     7  * @ date:2020/8/2 00:05
     8  */
     9 public class TargetForClassLoader {
    10 
    11     public static void main(String[] args) {
    12         bootstrapClassLoader();
    13 //        extClassLoader();
    14 //        appClassLoader();
    15 16 
    17     /**
    18      * 启动类加载器的职责
    19      */
    20     public static void bootstrapClassLoader() {
    21         String property = System.getProperty("sun.boot.class.path");
    22         List<String> list = Arrays.asList(property.split(";"));
    23         list.forEach((t) -> {
    24             System.out.println("启动类加载器目录:" + t);
    25         });
    26     }
    27 
    28 
    29     /**
    30      * 扩展类加载器
    31      */
    32     public static void extClassLoader() {
    33         String property = System.getProperty("java.ext.dirs");
    34         List<String> list = Arrays.asList(property.split(";"));
    35         list.forEach((t) -> {
    36             System.out.println("扩展类加载器" + t);
    37         });
    38     }
    39 
    40     /**
    41      * app 类加载器
    42      */
    43     public static void appClassLoader() {
    44         String property = System.getProperty("java.class.path");
    45         List<String> list = Arrays.asList(property.split(";"));
    46         list.forEach((t) -> {
    47             System.out.println("应用类加载器" + t);
    48         });
    49     }
    50 }
  • 相关阅读:
    开源数据汇集工具
    scrapy定时执行抓取任务
    xpath的常见操作
    ubuntu 安装python mysqldb
    sudo: /etc/sudoers is owned by uid 755, should be 0
    ubuntu 14.04安装mysql数据库
    win7 远程桌面连接centos 6.5
    本地启动spark-shell
    ubuntu 安装 2.10.x版本的scala
    unfolding maps支持中文
  • 原文地址:https://www.cnblogs.com/xuqing0422/p/13417445.html
Copyright © 2011-2022 走看看