Java 9中的类加载器层次结构 [英] Classloaders hierarchy in Java 9

查看:452
本文介绍了Java 9中的类加载器层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Java-8开始,我知道类加载器的层次结构如下: -

As of Java-8, I know the hierarchy of the classloaders has been as follows:-


Bootstrap类加载器 - >扩展类加载器 - >应用程序类加载器

Bootstrap classloader -> Extension classloader -> Application classloader

Java 9中类加载器层次结构的变化是什么?它是如何工作的?

What is the change in the hierarchy of classloaders in Java 9 and how does it works?

推荐答案

ClassLoader 表示:


Java运行时具有以下内置类加载器:

The Java run-time has the following built-in class loaders:


  • Bootstrap类加载器 :虚拟机的内置类加载器通常表示为null,并且没有父级。

  • Bootstrap class loader: The virtual machine's built-in class loader typically represented as null, and does not have a parent.

平台类加载器
允许升级/覆盖定义到平台的模块orm
类加载器,升级模块读取模块定义到类
除了平台类加载器及其祖先之外的加载器,然后
平台类加载器可能必须委托给其他类加载器,例如,
应用程序类加载器。 换句话说,
中的类被定义为除平台类
loader及其祖先之外的类加载器的类可能对平台类加载器
可见。

系统类加载器 :它是也称为应用程序类加载器并且与平台类加载器不同。系统
类加载器通常用于定义应用程序
类路径,模块路径和JDK特定工具
上的类。平台类
loader是系统类加载器的父级或祖先,所有
平台类都是可见的。

System class loader: It is also known as application class loader and is distinct from the platform class loader. The system class loader is typically used to define classes on the application class path, module path, and JDK-specific tools. The platform class loader is a parent or an ancestor of the system class loader that all platform classes are visible to it.

这篇关于Java 9中的类加载器层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆