{"id":749,"date":"2022-12-31T01:53:09","date_gmt":"2023-12-10T07:26:57","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/"},"modified":"2025-08-01T02:08:49","modified_gmt":"2025-07-31T17:08:49","slug":"java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/","title":{"rendered":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc"},"content":{"rendered":"<p>Java\u306eClassLoader\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u958b\u767a\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u304c\u3089\u3082\u3042\u307e\u308a\u4f7f\u7528\u3055\u308c\u306a\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4e00\u3064\u3067\u3059\u3002\u79c1\u306f\u4eca\u307e\u3067\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067ClassLoader\u3092\u62e1\u5f35\u3057\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Java\u306e\u30af\u30e9\u30b9\u306e\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u308b\u72ec\u81ea\u306eClassLoader\u3092\u6301\u3064\u3068\u3044\u3046\u30a2\u30a4\u30c7\u30a3\u30a2\u306f\u9b45\u529b\u7684\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Java\u306eClassLoader\u306e\u6982\u8981\u3092\u63d0\u4f9b\u3057\u3001\u305d\u306e\u5f8cJava\u3067\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>Java ClassLoader\u3068\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h2>\n<p>\u79c1\u305f\u3061\u306fJava\u30d7\u30ed\u30b0\u30e9\u30e0\u304cJava\u4eee\u60f3\u30de\u30b7\u30f3\uff08JVM\uff09\u4e0a\u3067\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u3092\u77e5\u3063\u3066\u3044\u307e\u3059\u3002Java\u30af\u30e9\u30b9\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u3001JVM\u306f\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3084\u30de\u30b7\u30f3\u306b\u4f9d\u5b58\u3057\u306a\u3044\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30d0\u30a4\u30c8\u30b3\u30fc\u30c9\u306f\u3001.class\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u304c\u30e1\u30e2\u30ea\u306b\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<h2>\u7d44\u307f\u8fbc\u307f\u306eClassLoader\u306e\u7a2e\u985e<\/h2>\n<p>Java\u306b\u306f3\u3064\u306e\u7d44\u307f\u8fbc\u307f\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306e\u30bf\u30a4\u30d7\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306f\u3001JDK\u306e\u5185\u90e8\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001java.lang.* \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30af\u30e9\u30b9\u306a\u3069\u3001rt.jar\u3084\u4ed6\u306e\u30b3\u30a2\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u62e1\u5f35\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306f\u3001\u901a\u5e38$JAVA_HOME\/lib\/ext\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304b\u3089JDK\u306e\u62e1\u5f35\u6a5f\u80fd\u306e\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30b7\u30b9\u30c6\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306f\u3001\u73fe\u5728\u306e\u30af\u30e9\u30b9\u30d1\u30b9\u304b\u3089\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002-cp\u307e\u305f\u306f-classpath\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8d77\u52d5\u3059\u308b\u969b\u306b\u30af\u30e9\u30b9\u30d1\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/ol>\n<h2>\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306e\u968e\u5c64<\/h2>\n<p>\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306f\u3001\u30af\u30e9\u30b9\u3092\u30e1\u30e2\u30ea\u306b\u30ed\u30fc\u30c9\u3059\u308b\u969b\u306b\u968e\u5c64\u7684\u306b\u306a\u308a\u307e\u3059\u3002\u30af\u30e9\u30b9\u306e\u30ed\u30fc\u30c9\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u767a\u751f\u3059\u308b\u3068\u3001\u89aa\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306b\u59d4\u4efb\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u5b9f\u884c\u74b0\u5883\u3067\u30e6\u30cb\u30fc\u30af\u3055\u304c\u7dad\u6301\u3055\u308c\u307e\u3059\u3002\u3082\u3057\u89aa\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u304c\u30af\u30e9\u30b9\u3092\u898b\u3064\u3051\u3089\u308c\u306a\u3044\u5834\u5408\u3001\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u81ea\u4f53\u304c\u30af\u30e9\u30b9\u3092\u30ed\u30fc\u30c9\u3057\u3088\u3046\u3068\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306eJava\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u308c\u3092\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.classloader;\r\n\r\npublic class ClassLoaderTest {\r\n\r\n    public static void main(String[] args) {\r\n\r\n        System.out.println(\"class loader for HashMap: \"\r\n                + java.util.HashMap.class.getClassLoader());\r\n        System.out.println(\"class loader for DNSNameService: \"\r\n                + sun.net.spi.nameservice.dns.DNSNameService.class\r\n                        .getClassLoader());\r\n        System.out.println(\"class loader for this class: \"\r\n                + ClassLoaderTest.class.getClassLoader());\r\n\r\n        System.out.println(com.mysql.jdbc.Blob.class.getClassLoader());\r\n\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u300c\u3053\u3061\u3089\u306e\u60c5\u5831\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306b\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u8907\u6570\u306e\u9078\u629e\u80a2\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code>class loader for HashMap: null\r\nclass loader for DNSNameService: sun.misc.Launcher$ExtClassLoader@7c354093\r\nclass loader for this class: sun.misc.Launcher$AppClassLoader@64cbbe37\r\nsun.misc.Launcher$AppClassLoader@64cbbe37\r\n<\/code><\/pre>\n<h2>Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306f\u3069\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u306e\u3067\u3059\u304b\uff1f<\/h2>\n<p>\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u304b\u3089\u3001\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306e\u52d5\u4f5c\u3092\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul class=\"post-ul\">\n<li>The java.util.HashMap ClassLoader is coming as null, which reflects Bootstrap ClassLoader. The DNSNameService class ClassLoader is ExtClassLoader. Since the class itself is in CLASSPATH, System ClassLoader loads it.<\/li>\n<li>When we are trying to load HashMap, our System ClassLoader delegates it to the Extension ClassLoader. The extension class loader delegates it to the Bootstrap ClassLoader. The bootstrap class loader finds the HashMap class and loads it into the JVM memory.<\/li>\n<li>The same process is followed for the DNSNameService class. But, the Bootstrap ClassLoader is not able to locate it since it\u2019s in $JAVA_HOME\/lib\/ext\/dnsns.jar. Hence, it gets loaded by Extensions Classloader.<\/li>\n<li>The Blob class is included in the MySql JDBC Connector jar (mysql-connector-java-5.0.7-bin.jar), which is present in the build path of the project. It\u2019s also getting loaded by the System Classloader.<\/li>\n<li>The classes loaded by a child class loader have visibility into classes loaded by its parent class loaders. So classes loaded by System Classloader have visibility into classes loaded by Extensions and Bootstrap Classloader.<\/li>\n<li>If there are sibling class loaders then they can\u2019t access classes loaded by each other.<\/li>\n<\/ul>\n<h2>\u306a\u305cJava\u3067\u30ab\u30b9\u30bf\u30e0\u306eClassLoader\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u3059\u304b\uff1f<\/h2>\n<p>Java\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306eClassLoader\u306f\u3001\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u306b\u306f\u30ed\u30fc\u30ab\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u5b9f\u884c\u6642\u3084FTP\u30b5\u30fc\u30d0\u30fc\u3084\u7b2c\u4e09\u8005\u306eWeb\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u62e1\u5f35\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001AppletViewers\u306f\u30ea\u30e2\u30fc\u30c8\u306eWeb\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<h2>Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u300cJava\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u30e1\u30bd\u30c3\u30c9\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/h2>\n<ul class=\"post-ul\">\n<li>When JVM requests for a class, it invokes loadClass() function of the ClassLoader by passing the fully classified name of the Class.<\/li>\n<li>The loadClass() function calls the findLoadedClass() method to check that the class has been already loaded or not. It\u2019s required to avoid loading the same class multiple times.<\/li>\n<li>If the Class is not already loaded, then it will delegate the request to parent ClassLoader to load the class.<\/li>\n<li>If the parent ClassLoader doesn\u2019t find the class then it will invoke findClass() method to look for the classes in the file system.<\/li>\n<\/ul>\n<h2>Java\u306e\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306e\u4f8b\u3068\u306f\u3001\u7570\u306a\u308b\u5834\u6240\u304b\u3089\u30af\u30e9\u30b9\u3092\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65649e66daa94e2bdf7c207c\/19-0.png\" alt=\"Java Custom ClassLoader Example\" \/><\/div>\n<h3>1. CCLoader.java \u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306b\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/h3>\n<p>\u4ee5\u4e0b\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u6301\u3064\u79c1\u305f\u3061\u306e\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>name\u3068\u3044\u3046\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u30d0\u30a4\u30c8\u914d\u5217\u306b\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>name\u3068\u3044\u3046\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001loadClassFileData()\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3001\u89aa\u306edefineClass()\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066Class\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092\u8fd4\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>name\u3068\u3044\u3046\u540d\u524d\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30af\u30e9\u30b9\u3092\u30ed\u30fc\u30c9\u3059\u308b\u8cac\u4efb\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u30af\u30e9\u30b9\u540d\u304ccom.scdev\uff08\u30b5\u30f3\u30d7\u30eb\u30af\u30e9\u30b9\uff09\u3067\u59cb\u307e\u308b\u5834\u5408\u3001getClass()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u305d\u308c\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f\u3001\u89aaloadClass()\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u305d\u308c\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>CCLoader\uff08ClassLoader parent\uff09\u306f\u3001\u89aaClassLoader\u3092\u8a2d\u5b9a\u3059\u308b\u5f79\u5272\u3092\u6301\u3064\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u3059\u3002<\/ol>\n<pre class=\"post-pre\"><code>import java.io.DataInputStream;\r\nimport java.io.File;\r\nimport java.io.IOException;\r\nimport java.io.InputStream;\r\n \r\n\/**\r\n * Our Custom ClassLoader to load the classes. Any class in the com.scdev\r\n * package will be loaded using this ClassLoader. For other classes, it will delegate the request to its Parent ClassLoader.\r\n *\r\n *\/\r\npublic class CCLoader extends ClassLoader {\r\n \r\n    \/**\r\n     * This constructor is used to set the parent ClassLoader\r\n     *\/\r\n    public CCLoader(ClassLoader parent) {\r\n        super(parent);\r\n    }\r\n \r\n    \/**\r\n     * Loads the class from the file system. The class file should be located in\r\n     * the file system. The name should be relative to get the file location\r\n     *\r\n     * @param name\r\n     *            Fully Classified name of the class, for example, com.scdev.Foo\r\n     *\/\r\n    private Class getClass(String name) throws ClassNotFoundException {\r\n        String file = name.replace('.', File.separatorChar) + \".class\";\r\n        byte[] b = null;\r\n        try {\r\n            \/\/ This loads the byte code data from the file\r\n            b = loadClassFileData(file);\r\n            \/\/ defineClass is inherited from the ClassLoader class\r\n            \/\/ that converts byte array into a Class. defineClass is Final\r\n            \/\/ so we cannot override it\r\n            Class c = defineClass(name, b, 0, b.length);\r\n            resolveClass(c);\r\n            return c;\r\n        } catch (IOException e) {\r\n            e.printStackTrace();\r\n            return null;\r\n        }\r\n    }\r\n \r\n    \/**\r\n     * Every request for a class passes through this method. If the class is in\r\n     * com.scdev package, we will use this classloader or else delegate the\r\n     * request to parent classloader.\r\n     *\r\n     *\r\n     * @param name\r\n     *            Full class name\r\n     *\/\r\n    @Override\r\n    public Class loadClass(String name) throws ClassNotFoundException {\r\n        System.out.println(\"Loading Class '\" + name + \"'\");\r\n        if (name.startsWith(\"com.scdev\")) {\r\n            System.out.println(\"Loading Class using CCLoader\");\r\n            return getClass(name);\r\n        }\r\n        return super.loadClass(name);\r\n    }\r\n \r\n    \/**\r\n     * Reads the file (.class) into a byte array. The file should be\r\n     * accessible as a resource and make sure that it's not in Classpath to avoid\r\n     * any confusion.\r\n     *\r\n     * @param name\r\n     *            Filename\r\n     * @return Byte array read from the file\r\n     * @throws IOException\r\n     *             if an exception comes in reading the file\r\n     *\/\r\n    private byte[] loadClassFileData(String name) throws IOException {\r\n        InputStream stream = getClass().getClassLoader().getResourceAsStream(\r\n                name);\r\n        int size = stream.available();\r\n        byte buff[] = new byte[size];\r\n        DataInputStream in = new DataInputStream(stream);\r\n        in.readFully(buff);\r\n        in.close();\r\n        return buff;\r\n    }\r\n}\r\n<\/code><\/pre>\n<h3>2. CCRun.java\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3002<\/h3>\n<p>\u3053\u308c\u306f\u79c1\u305f\u3061\u306e\u30c6\u30b9\u30c8\u30af\u30e9\u30b9\u3067\u3001\u30e1\u30a4\u30f3\u95a2\u6570\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u79c1\u305f\u3061\u306fClassLoader\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3001\u305d\u306eloadClass()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30f3\u30d7\u30eb\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u30af\u30e9\u30b9\u3092\u8aad\u307f\u8fbc\u3093\u3060\u5f8c\u3001Java\u306e\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3API\u3092\u4f7f\u7528\u3057\u3066\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>import java.lang.reflect.Method;\r\n \r\npublic class CCRun {\r\n \r\n    public static void main(String args[]) throws Exception {\r\n        String progClass = args[0];\r\n        String progArgs[] = new String[args.length - 1];\r\n        System.arraycopy(args, 1, progArgs, 0, progArgs.length);\r\n\r\n        CCLoader ccl = new CCLoader(CCRun.class.getClassLoader());\r\n        Class clas = ccl.loadClass(progClass);\r\n        Class mainArgType[] = { (new String[0]).getClass() };\r\n        Method main = clas.getMethod(\"main\", mainArgType);\r\n        Object argsArray[] = { progArgs };\r\n        main.invoke(null, argsArray);\r\n\r\n        \/\/ Below method is used to check that the Foo is getting loaded\r\n        \/\/ by our custom class loader i.e CCLoader\r\n        Method printCL = clas.getMethod(\"printCL\", null);\r\n        printCL.invoke(null, new Object[0]);\r\n    }\r\n \r\n}\r\n<\/code><\/pre>\n<h3>\uff13. Foo.java\u3068Bar.java<\/h3>\n<p>\u3053\u308c\u3089\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306b\u3088\u3063\u3066\u30ed\u30fc\u30c9\u3055\u308c\u308b\u79c1\u305f\u3061\u306e\u30c6\u30b9\u30c8\u30af\u30e9\u30b9\u3067\u3059\u3002\u305d\u308c\u3089\u306b\u306fprintCL\uff08\uff09\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u3001ClassLoader\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002Foo\u30af\u30e9\u30b9\u306f\u79c1\u305f\u3061\u306e\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306b\u3088\u3063\u3066\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002Foo\u306fBar\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001Bar\u30af\u30e9\u30b9\u3082\u79c1\u305f\u3061\u306e\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306b\u3088\u3063\u3066\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.cl;\r\n \r\npublic class Foo {\r\n    static public void main(String args[]) throws Exception {\r\n        System.out.println(\"Foo Constructor &gt;&gt;&gt; \" + args[0] + \" \" + args[1]);\r\n        Bar bar = new Bar(args[0], args[1]);\r\n        bar.printCL();\r\n    }\r\n \r\n    public static void printCL() {\r\n        System.out.println(\"Foo ClassLoader: \"+Foo.class.getClassLoader());\r\n    }\r\n}\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>package com.scdev.cl;\r\n \r\npublic class Bar {\r\n \r\n    public Bar(String a, String b) {\r\n        System.out.println(\"Bar Constructor &gt;&gt;&gt; \" + a + \" \" + b);\r\n    }\r\n \r\n    public void printCL() {\r\n        System.out.println(\"Bar ClassLoader: \"+Bar.class.getClassLoader());\r\n    }\r\n}\r\n<\/code><\/pre>\n<h3>4. Java \u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306e\u5b9f\u884c\u624b\u9806<\/h3>\n<p>\u307e\u305a\u3001\u6700\u521d\u306b\u3001\u3059\u3079\u3066\u306e\u30af\u30e9\u30b9\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002\u305d\u306e\u5f8c\u3001CCRun\u30af\u30e9\u30b9\u30923\u3064\u306e\u5f15\u6570\u3092\u6e21\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002\u6700\u521d\u306e\u5f15\u6570\u306f\u3001\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u306b\u3088\u3063\u3066\u8aad\u307f\u8fbc\u307e\u308c\u308bFoo\u30af\u30e9\u30b9\u306e\u5b8c\u5168\u5206\u985e\u3055\u308c\u305f\u540d\u524d\u3067\u3059\u3002\u4ed6\u306e2\u3064\u306e\u5f15\u6570\u306f\u3001Foo\u30af\u30e9\u30b9\u306emain\u95a2\u6570\u3068Bar\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u6e21\u3055\u308c\u307e\u3059\u3002\u5b9f\u884c\u624b\u9806\u3068\u51fa\u529b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>$ javac -cp . com\/scdev\/cl\/Foo.java\r\n$ javac -cp . com\/scdev\/cl\/Bar.java\r\n$ javac CCLoader.java\r\n$ javac CCRun.java\r\nCCRun.java:18: warning: non-varargs call of varargs method with inexact argument type for last parameter;\r\ncast to java.lang.Class&lt;?&gt; for a varargs call\r\ncast to java.lang.Class&lt;?&gt;[] for a non-varargs call and to suppress this warning\r\nMethod printCL = clas.getMethod(\"printCL\", null);\r\n^\r\n1 warning\r\n$ java CCRun com.scdev.cl.Foo 1212 1313\r\nLoading Class 'com.scdev.cl.Foo'\r\nLoading Class using CCLoader\r\nLoading Class 'java.lang.Object'\r\nLoading Class 'java.lang.String'\r\nLoading Class 'java.lang.Exception'\r\nLoading Class 'java.lang.System'\r\nLoading Class 'java.lang.StringBuilder'\r\nLoading Class 'java.io.PrintStream'\r\nFoo Constructor &gt;&gt;&gt; 1212 1313\r\nLoading Class 'com.scdev.cl.Bar'\r\nLoading Class using CCLoader\r\nBar Constructor &gt;&gt;&gt; 1212 1313\r\nLoading Class 'java.lang.Class'\r\nBar ClassLoader: CCLoader@71f6f0bf\r\nFoo ClassLoader: CCLoader@71f6f0bf\r\n$\r\n<\/code><\/pre>\n<p>\u51fa\u529b\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001com.scdev.cl.Foo\u30af\u30e9\u30b9\u306e\u30ed\u30fc\u30c9\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002java.lang.Object\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u307e\u305aObject\u30af\u30e9\u30b9\u306e\u30ed\u30fc\u30c9\u3092\u8a66\u307f\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u8981\u6c42\u306fCCLoader\u306eloadClass\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u3001\u305d\u3053\u304b\u3089\u89aa\u30af\u30e9\u30b9\u306b\u59d4\u8b72\u3055\u308c\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u89aa\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u304cObject\u30af\u30e9\u30b9\u3001String\u30af\u30e9\u30b9\u3001\u4ed6\u306eJava\u30af\u30e9\u30b9\u3092\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002\u79c1\u305f\u3061\u306eClassLoader\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089Foo\u30af\u30e9\u30b9\u3068Bar\u30af\u30e9\u30b9\u306e\u307f\u3092\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002printCL()\u95a2\u6570\u306e\u51fa\u529b\u304b\u3089\u306f\u660e\u3089\u304b\u3067\u3059\u3002loadClassFileData()\u306e\u6a5f\u80fd\u3092\u5909\u66f4\u3057\u3066\u3001\u30af\u30e9\u30b9\u306e\u30d0\u30a4\u30c8\u914d\u5217\u3092FTP\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u8aad\u307f\u8fbc\u3080\u304b\u3001\u30af\u30e9\u30b9\u306e\u30d0\u30a4\u30c8\u914d\u5217\u3092\u52d5\u7684\u306b\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u30b5\u30fc\u30d3\u30b9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u304cJava ClassLoader\u306e\u52d5\u4f5c\u3084\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u306e\u53d6\u5f97\u3060\u3051\u3067\u306a\u304f\u3001\u305d\u308c\u4ee5\u4e0a\u306e\u3053\u3068\u3092\u884c\u3046\u305f\u3081\u306b\u3069\u306e\u3088\u3046\u306b\u62e1\u5f35\u3067\u304d\u308b\u304b\u3092\u7406\u89e3\u3059\u308b\u306e\u306b\u5f79\u7acb\u3066\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<h2>\u30c7\u30d5\u30a9\u30eb\u30c8\u306eClassLoader\u3068\u3057\u3066\u30ab\u30b9\u30bf\u30e0ClassLoader\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<p>JVM\u304c\u8d77\u52d5\u3059\u308b\u969b\u306b\u3001Java\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Java\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u304b\u3089\u3001\u518d\u5ea6ClassLoaderTest\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>$ javac -cp .:..\/lib\/mysql-connector-java-5.0.7-bin.jar com\/scdev\/classloader\/ClassLoaderTest.java\r\n$ java -cp .:..\/lib\/mysql-connector-java-5.0.7-bin.jar -Djava.system.class.loader=CCLoader com.scdev.classloader.ClassLoaderTest\r\nLoading Class 'com.scdev.classloader.ClassLoaderTest'\r\nLoading Class using CCLoader\r\nLoading Class 'java.lang.Object'\r\nLoading Class 'java.lang.String'\r\nLoading Class 'java.lang.System'\r\nLoading Class 'java.lang.StringBuilder'\r\nLoading Class 'java.util.HashMap'\r\nLoading Class 'java.lang.Class'\r\nLoading Class 'java.io.PrintStream'\r\nclass loader for HashMap: null\r\nLoading Class 'sun.net.spi.nameservice.dns.DNSNameService'\r\nclass loader for DNSNameService: sun.misc.Launcher$ExtClassLoader@24480457\r\nclass loader for this class: CCLoader@38503429\r\nLoading Class 'com.mysql.jdbc.Blob'\r\nsun.misc.Launcher$AppClassLoader@2f94ca6c\r\n$\r\n<\/code><\/pre>\n<p>CCLoader\u306fcom.scdev\u30d1\u30c3\u30b1\u30fc\u30b8\u306bClass Loader Test\u30af\u30e9\u30b9\u304c\u3042\u308b\u305f\u3081\u3001\u305d\u308c\u3092\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5f53\u793e\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u3001ClassLoader\u306e\u4f8b\u306e\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u306eClassLoader\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u958b\u767a\u306b\u304a\u3044\u3066\u91cd\u8981\u306a\u304c\u3089\u3082\u3042\u307e\u308a\u4f7f\u7528\u3055\u308c\u306a\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4e00\u3064\u3067\u3059\u3002\u79c1\u306f\u4eca\u307e\u3067\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067ClassLoader\u3092\u62e1\u5f35\u3057\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001Java\u306e\u30af\u30e9\u30b9\u306e\u30ed\u30fc\u30c7\u30a3 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-749","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\" \/>\n<meta property=\"og:description\" content=\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-10T07:26:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T17:08:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65649e66daa94e2bdf7c207c\/19-0.png\" \/>\n<meta name=\"author\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"26\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/\",\"name\":\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-12-10T07:26:57+00:00\",\"dateModified\":\"2025-07-31T17:08:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\"},\"description\":\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\",\"name\":\"\u512a\u6597, \u671d\u967d\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"caption\":\"\u512a\u6597, \u671d\u967d\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc - Blog - Silicon Cloud","description":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\/","og_locale":"ja_JP","og_type":"article","og_title":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc","og_description":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-10T07:26:57+00:00","article_modified_time":"2025-07-31T17:08:49+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/65649e66daa94e2bdf7c207c\/19-0.png"}],"author":"\u512a\u6597, \u671d\u967d","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u512a\u6597, \u671d\u967d","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"26\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/","name":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-12-10T07:26:57+00:00","dateModified":"2025-07-31T17:08:49+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28"},"description":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u30fc"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28","name":"\u512a\u6597, \u671d\u967d","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","caption":"\u512a\u6597, \u671d\u967d"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e3%83%ad%e3%83%bc%e3%83%80%e3%83%bc\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=749"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":44537,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/749\/revisions\/44537"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}