{"id":10254,"date":"2023-03-25T12:14:17","date_gmt":"2023-03-25T04:14:17","guid":{"rendered":"http:\/\/123.57.164.21\/?p=10254"},"modified":"2023-03-25T12:14:17","modified_gmt":"2023-03-25T04:14:17","slug":"%e6%b7%b1%e5%85%a5%e6%8e%a2%e7%a9%b6java%e9%a1%b9%e7%9b%ae%e4%b8%ad%e7%9a%84classpath","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=10254","title":{"rendered":"\u6df1\u5165\u63a2\u7a76Java\u9879\u76ee\u4e2d\u7684classpath"},"content":{"rendered":"\n<p><strong>1. \u5f15\u8a00<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u5728Java\u7f16\u7a0b\u7684\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5e38\u6d89\u53ca\u5230\u5bf9\u672c\u5730\u8d44\u6e90\u7684\u8bfb\u53d6\u3002\u6bd4\u5982\uff0cSSM\u6846\u67b6\u4e2d\uff0c\u901a\u8fc7Spring\u6846\u67b6\u9700\u8981\u8bfb\u53d6\u5176\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\u6765\u5b9e\u73b0\u5bf9SpringBean\u7684\u5b9e\u4f8b\u5316\u3002Mybatis\u6846\u67b6\u9700\u8981\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u6765\u83b7\u53d6\u6570\u636e\u5e93\u76f8\u5173\u7684\u53c2\u6570\u3002SpringMVC\u4e5f\u9700\u8981\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff0c\u83b7\u5f97\u524d\u7aef\u63a7\u5236\u5668\u7684\u914d\u7f6e\u53c2\u6570\u3002<\/p>\n\n\n\n<p>\u5728\u666e\u901a\u7684Java\u9879\u76ee\u4e2d\uff0c\u4e5f\u9700\u8981\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u6765\u63d0\u9ad8\u5bf9\u7a0b\u5e8f\u7684\u7ef4\u62a4\u6027\u3002\u4e00\u4e2a\u5e38\u89c1\u7684\u8d44\u6e90\u8bfb\u53d6\u7c7bResourceBundle\uff0c\u5e38\u7528\u6765\u8fd9\u4e2a\u7c7b\u4e3b\u8981\u7528\u6765\u89e3\u51b3\u56fd\u9645\u5316\u548c\u672c\u5730\u5316\u95ee\u9898\u3002\u5f53\u7a0b\u5e8f\u9700\u8981\u4e00\u4e2a\u7279\u5b9a\u4e8e\u8bed\u8a00\u73af\u5883\u7684\u8d44\u6e90\u65f6\uff08\u5982 String\uff09\uff0c\u7a0b\u5e8f\u53ef\u4ee5\u4ece\u9002\u5408\u5f53\u524d\u7528\u6237\u8bed\u8a00\u73af\u5883\u7684\u8d44\u6e90\u5305\uff08\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u4e5f\u5c31\u662f.properties\u6587\u4ef6\uff09\u4e2d\u52a0\u8f7d\u5b83\u3002\u8fd9\u6837\u53ef\u4ee5\u7f16\u5199\u5f88\u5927\u7a0b\u5ea6\u4e0a\u72ec\u7acb\u4e8e\u7528\u6237\u8bed\u8a00\u73af\u5883\u7684\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5b83\u5c06\u8d44\u6e90\u5305\u4e2d\u5927\u90e8\u5206\uff08\u5373\u4fbf\u4e0d\u662f\u5168\u90e8\uff09\u7279\u5b9a\u4e8e\u8bed\u8a00\u73af\u5883\u7684\u4fe1\u606f\u9694\u79bb\u5f00\u6765\u3002<\/p>\n\n\n\n<p>\u6240\u6709\u7684\u8d44\u6e90\u8bfb\u53d6\u60c5\u51b5\uff0c\u90fd\u9700\u8981\u6d89\u53ca\u5230\u8def\u5f84\u7684\u6982\u5ff5\u3002\u8fd9\u91cc\u9762\u6709\u4e00\u4e2a\u5173\u952e\u7684\u8def\u5f84\uff0c\u4fbf\u662fclasspath\u3002<\/p>\n\n\n\n<p>\u6240\u8c13\u7684classpath\uff0c\u6307\u7684\u662f\u7c7b\u8def\u5f84, \u4e0d\u7ba1\u662fSSM\u6846\u67b6\u8fd8\u662fSpringBoot\u6846\u67b6\u4e0b,classpath\u5c31\u662f\u6307\u7c7b\u8def\u5f84\u3002\u4e5f\u5c31\u662fjava\u7a0b\u5e8f\u7f16\u8bd1\u540e\u540e.class\u6587\u4ef6\u7684\u6240\u5728\u7684\u8def\u5f84\u3002<\/p>\n\n\n\n<p><strong>2.Java\u7a0b\u5e8f\u6e90\u76ee\u5f55 \u4e0e classpath<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u4f17\u6240\u5468\u77e5\uff0cJava\u662f\u4e00\u79cd\u534a\u7f16\u8bd1\u534a\u89e3\u91ca\u578b\u7684\u8bed\u8a00\u3002\u7531\u7a0b\u5e8f\u5458\u5f00\u53d1\u7684.java\u7a0b\u5e8f\uff0c\u9700\u8981\u7ecf\u8fc7javac\u7f16\u8bd1\u4e3a.class\u5b57\u8282\u7801\u6587\u4ef6\uff0c\u6700\u540e\u6709Java\u865a\u62df\u673a\u5c06\u5b57\u8282\u7801\u89e3\u91ca\u4e3a\u4e8c\u8fdb\u5236\u673a\u5668\u7801\u3002\u5176\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-320-1024x209.png\" alt=\"\" class=\"wp-image-10255\" width=\"428\" height=\"87\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-1024x209.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-300x61.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-768x157.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-830x170.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-230x47.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-350x72.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320-480x98.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-320.png 1116w\" sizes=\"(max-width: 428px) 100vw, 428px\" \/><\/figure><\/div>\n\n\n\n<p><br><\/p>\n\n\n\n<p>\u7531\u4e8eJava\u9879\u76ee\u6700\u7ec8\u90fd\u9700\u8981\u7ecf\u8fc7\u7f16\u8bd1\u4e3a\u5b57\u8282\u7801\u6587\u4ef6\u3002\u6240\u4ee5\uff0c\u5728\u6211\u4eec\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u7684\u5305\u542b.java\u6587\u4ef6\u7684\u76ee\u5f55\u8def\u5f84\uff0c\u4e0e\u7a0b\u5e8f\u6700\u7ec8\u7684\u5305\u542b.class\u6587\u4ef6\u7684\u76ee\u5f55\u8def\u5f84\u662f\u6709\u6240\u4e0d\u540c\u7684\u3002\u7a0b\u5e8f\u6700\u7ec8\u57fa\u4e8e\u8def\u5f84\u8bfb\u53d6\u8d44\u6e90\u6587\u4ef6\uff0c\u90fd\u662f\u5728\u5305\u542b.class\u6587\u4ef6\u7684\u76ee\u5f55\u4e2d\u8bfb\u53d6\u7684\u3002\u4e3a\u4e86\u4fdd\u8bc1\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u8def\u5f84\u7684\u6b63\u786e\u8bfb\u53d6\uff0c\u6211\u4eec\u9700\u8981\u4e86\u89e3Java\u6e90\u7a0b\u5e8f\u4e2d\u7684\u7684\u76ee\u5f55\u7ed3\u6784 \u4e0e \u7f16\u8bd1\u540e\u7684\u76ee\u5f55\u7ed3\u6784\u7684\u6620\u5c04\u5173\u7cfb\u3002<\/p>\n\n\n\n<p><strong>2.1 Java\u6e90\u7a0b\u5e8f\u7684\u76ee\u5f55\u7ed3\u6784<\/strong><br><\/p>\n\n\n\n<p>\u5728\u5e38\u89c1\u7684Java\u9879\u76ee\uff0c\u4e3b\u8981\u5206\u4e3a\u666e\u901a\u7684Java\u9879\u76ee\u548cJava<a href=\"https:\/\/so.csdn.net\/so\/search?q=Web%E9%A1%B9%E7%9B%AE&amp;spm=1001.2101.3001.7020\" target=\"_blank\" rel=\"noreferrer noopener\">Web\u9879\u76ee<\/a>\u3002\u4e00\u822c\u800c\u8a00\uff0cJavaWeb\u9879\u76ee\u8f83\u666e\u901a\u7684Java\u9879\u76ee\u7684\u76ee\u5f55\u7ed3\u6784\u53ea\u6709\u5c11\u8bb8\u4e0d\u540c\uff1a<\/p>\n\n\n\n<p>\u5bf9\u6bd4\u4e24\u8005\u7684\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-321-1024x532.png\" alt=\"\" class=\"wp-image-10256\" width=\"496\" height=\"257\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-1024x532.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-300x156.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-768x399.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-1536x798.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-830x431.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-230x119.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-350x182.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321-480x249.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-321.png 1544w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/figure><\/div>\n\n\n\n<p>\u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0cJavaWeb\u9879\u76ee\u6bd4\u666e\u901a\u7684Java\u9879\u76ee\u591a\u4e86\u4e00\u4e2awebapp\u6587\u4ef6\u5939\uff0c\u8be5\u6587\u4ef6\u5939\u4e3b\u8981\u662f\u5b58\u653e\u4e00\u4e9b\u524d\u7aef\u7684\u9875\u9762\u4fe1\u606f\u3002\u4e14\u4e24\u4e2a\u9879\u76ee\u4e2d\uff0c\u5e26\u6709\u91d1\u9ec4\u8272\u6807\u5fd7\u7684\u7684res\/resources\u6587\u4ef6\u90fd\u662f\u7528\u6765\u5b58\u653e\u5f00\u53d1\u73af\u5883\u4e0b\u7684\u8d44\u6e90\u6587\u4ef6\u7684\u3002<\/p>\n\n\n\n<p><strong>2.2 \u672c\u5730\u73af\u5883\u4e0b\u7684Java\u7a0b\u5e8f\u7684classpath.<\/strong><\/p>\n\n\n\n<p>\u5728\u4e00\u4e2a\u666e\u901a\u7684\u7684java\u9879\u76ee\u4e2d\uff0c.java\u683c\u5f0f\u7684\u6e90\u6587\u4ef6\u6700\u7ec8\u4f1a\u88ab\u6253\u5305\u4e3a.class\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u7ecf\u8fc7\u7c7b\u52a0\u8f7d\u5668\u7684\u52a0\u8f7d\uff0c\u8fd0\u884c\u5728Java\u865a\u62df\u673a\u4e2d\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2aJava\u7a0b\u5e8f\uff0c\u4f1a\u7531\u81ea\u52a8\u5316\u6784\u5efa\u5de5\u5177\u5bf9\u6240\u6709\u7684\u6e90\u7801\u8fdb\u884c\u6784\u5efa\uff0c\u9ed8\u8ba4\u4f1a\u6700\u7ec8\u751f\u6210\u4e00\u4e2atarget\u76ee\u5f55\u3002 \u8be5\u76ee\u5f55\u5b58\u653e\u9879\u76ee\u6784\u5efa\u540e\u7684\u6587\u4ef6\u548c\u76ee\u5f55\uff0cjar\u5305\uff0cwar\u5305\u548c\u7f16\u8bd1\u540e\u7684class\u6587\u4ef6\u3002\u4e00\u4e2a\u666e\u901a\u7684\u7684Java\u7a0b\u5e8f\u4e0e\u4e00\u4e2aJavaWeb\u9879\u76ee\u7f16\u8bd1\u4e4b\u540e\u7684Target\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-322-975x1024.png\" alt=\"\" class=\"wp-image-10257\" width=\"383\" height=\"402\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-975x1024.png 975w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-286x300.png 286w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-768x807.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-830x872.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-230x242.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-350x368.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322-480x504.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-322.png 1304w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure><\/div>\n\n\n\n<p><br><\/p>\n\n\n\n<p>\u89c2\u5bdf\u5230\u4e0a\u56fe\u56fe2\u4e2d\uff0c\u51fa\u73b0\u4e86\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6mybatis.xml\u7b49.\u8fd9\u4e9b\u6587\u4ef6\u5bf9\u5e94\u5728\u6e90\u6587\u4ef6src\/main\/resources\u4e0b\u3002\u6240\u4ee5\u53ef\u4ee5\u63a8\u65ad\uff0cresources\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u6700\u7ec8\u4f1a\u88ab\u6253\u5305\u81f3target\/classes.<\/p>\n\n\n\n<p>\u4e4b\u6240\u4ee5\u4e24\u79cd\u9879\u76ee\u6700\u540e\u5747\u4f1a\u751f\u6210target\u76ee\u5f55\uff0c\u662f\u56e0\u4e3aidea\u4e2d\uff0c\u9ed8\u8ba4\u5c06\u9879\u76ee\u6a21\u5757\u7684\u7f16\u8bd1\u7ed3\u679c\u8f93\u51fa\u5230target\u76ee\u5f55\u4e2d\u3002\u6253\u5f00idea\u7684project structure \u8bbe\u7f6e\uff0c\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u9875\u9762\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-323-1024x306.png\" alt=\"\" class=\"wp-image-10258\" width=\"533\" height=\"159\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-1024x306.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-300x90.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-768x230.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-830x248.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-230x69.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-350x105.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323-480x144.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-323.png 1304w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><\/figure><\/div>\n\n\n\n<p><br>\u6240\u4ee5\uff0c\u5728\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\uff0cJava\u9879\u76ee\u4e2d\u7684<strong>classpath\u8def\u5f84\uff0c\u5c31\u662ftarget\/classes<\/strong>.<\/p>\n\n\n\n<p><strong>2.3 Java\u9879\u76ee\u4e0eJavaWeb\u9879\u76ee\u7684classpath\u533a\u522b\u3002<\/strong><\/p>\n\n\n\n<p>\u4e00\u822c\u800c\u8a00\uff0cJava\u9879\u76ee\u4e3b\u8981\u9762\u5411\u684c\u9762\u7a0b\u5e8f\u7684\u5e94\u7528\uff0c\u4e3b\u8981\u662fawt\u3001swing\u8fd9\u7c7b\u7684\u7f16\u7801\uff0c\u4e0d\u5305\u62ecJSP\u7b49\u524d\u53f0\u9875\u9762\u7684\u4ee3\u7801\uff0c\u5927\u90e8\u5206\u662fCS\u67b6\u6784\u7684\u5de5\u7a0b\u548c\u4e00\u4e9bjar\u5305\u3002JavaWeb\u9879\u76ee\u662fBS\u67b6\u6784\u7684\u7cfb\u7edf\uff0c\u662f\u7f51\u9875\u7684\u7f16\u7801\uff0c\u50cfJsp\u3001Servlet\u3001Struts\u8fd9\u7c7b\u7684\uff0c JavaWeb\u9879\u76ee\u90e8\u7f72\u5230\u670d\u52a1\u5668\u4e0a\uff0c\u4efb\u4f55\u7528\u6237\u90fd\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u6765\u8bbf\u95ee\u3002\u4e24\u8005\u7684classpath\u7684\u4e3b\u8981\u533a\u522b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul><li><strong>\u7f16\u8bd1\u540e\u8def\u5f84\u4e0d\u540c<\/strong>\u3002<\/li><\/ul>\n\n\n\n<p>Java Project\u548cWeb Project\u5176\u5b9e\u90fd\u662fJava\u8bed\u8a00\u7684\u5e94\u7528\uff0c\u53ea\u662f\u5e94\u7528\u573a\u5408\u4e0d\u540c\u7f62\u4e86\uff0c\u90a3\u4e48\u4ed6\u4eec\u7684\u672c\u8d28\u533a\u522b\u5230\u5e95\u662f\u7f16\u8bd1\u540e\u8def\u5f84\u4f4d\u7f6e\u4e0d\u540c\uff01\u5728Java\u9879\u76ee\u4e2d\uff0c.classpath\u6587\u4ef6\uff0c\u662f\u5728\u6bcf\u4e2a\u9879\u76ee\u7684\u76ee\u5f55\u4e0b\u5b58\u5728\u7684\u3002\u8be5\u9879\u76ee\u5b9a\u4e49\u4e86\u7f16\u8bd1\u540e\u7684\u8def\u5f84\u3002\u8fd9\u4e2a\u7f16\u8bd1\u540e\u7684\u8def\u5f84\uff0c\u4fbf\u662f\u672c\u6587\u4e2d\u6240\u8bf4\u7684classpath.<\/p>\n\n\n\n<p>\u4e0b\u9762\u5c55\u793a\u4e86\u4e00\u4e2aWeb\u9879\u76ee\u7684.classpath\u6587\u4ef6\uff0cxml\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">1. &lt;?xml version=\"1.0\" encoding=\"UTF-8\"?>\n2. &lt;classpath>\n3.       &lt;classpathentry kind=\"src\" path=\"src\"\/>\n4.       &lt;classpathentry kind=\"src\" path=\"resources\"\/>\n5.       &lt;classpathentry kind=\"src\" path=\"test\"\/>\n6.       &lt;classpathentry kind=\"uu\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"\/>\n7.       &lt;classpathentry kind=\"lib\" path=\"lib\/servlet-api.jar\"\/>\n8.       &lt;classpathentry kind=\"lib\" path=\"webapp\/WEB-INF\/lib\/struts2-core-2.1.8.1.jar\"\/>\n9.       \u2026\u2026\n10.     &lt;classpathentry kind=\"output\" path=\"webapp\/WEB-INF\/classes\"\/>\n11. &lt;\/classpath>\n<\/pre>\n\n\n\n<p><br><\/p>\n\n\n\n<p>\u5728xml\u6587\u6863\u5305\u542b\u4e00\u4e2a\u6839\u5143\u7d20\uff0c\u5c31\u662fclasspath\u7c7b\u8def\u5f84\u3002\u5b50\u5143\u7d20\u662fclasspathentry\uff0ckind\u5c5e\u6027\u533a\u522b\u4e86\u79cd\u7c7b\u4fe1\u606f\u3002src\u8868\u793a\u6e90\u7801\uff0cuu\u662fJRE\u5bb9\u5668\u7684\u76f8\u5173\u4fe1\u606f\u3002lib\u8868\u793a\u662f\u9879\u76ee\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u7c7b\u5e93\uff0coutput\u8868\u793asrc\u7f16\u8bd1\u540e\u7684\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p>\u7531\u4e8eWeb\u9879\u76ee\u662f\u8981\u53d1\u5e03\u5230\u670d\u52a1\u5668\u4e0a\u7684\uff0c\u670d\u52a1\u5668\u8bfb\u53d6\u7684\u662f\u7c7b\u6587\u4ef6\u548c\u9875\u9762\u6587\u4ef6\uff0c\u800c\u4e0d\u7ba1\u6e90\u6587\u4ef6\u3002\u5728\u670d\u52a1\u5668\u4e2d\uff0c\u662f\u5ffd\u7565WEB-INF\u4e0a\u4e00\u7ea7\u76ee\u5f55\u7684\uff0c\u800c\u76f4\u63a5\u4eceWEB-INF\u76ee\u5f55\u5f00\u59cb\u8bfb\u3002\u6240\u4ee5\uff0c\u6700\u7ec8\u7684\u8fd0\u884c\uff0c\u8ddf\u6211\u4eec\u5728\u5f00\u53d1\u73af\u5883\u4e2d\u4e2d\u547d\u540d\u4e3awebapp\u8fd8\u662fwebRoot\u65e0\u5173\u3002<\/p>\n\n\n\n<p><strong>3.Java\u7a0b\u5e8f\u5f00\u53d1\u76ee\u5f55\u4e0e\u90e8\u7f72\u76ee\u5f55\u7684\u5bf9\u6bd4\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><br>Java\u6e90\u7a0b\u5e8f\u6587\u4ef6\u6700\u7ec8\u4f1a\u88ab\u7f16\u8bd1\u5230\u76ee\u6807\u6587\u4ef6\u3002\u800c\u8fd9\u4e2a\u76ee\u6807\u6587\u4ef6\uff0c\u5c31\u662f\u6211\u4eec\u8bf4\u7684classpath.\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u6e90\u6587\u4ef6\u4e2d\u7684\u4ec0\u4e48\u76ee\u5f55\uff0c\u6700\u7ec8\u4f1a\u88ab\u7f16\u8bd1\u5230classes\u6587\u4ef6\uff0c\u4fbf\u53ef\u4ee5\u5c06\u9700\u8981\u4ececlasspath\u4e2d\u8bfb\u53d6\u7684\u6587\u4ef6\u4fe1\u606f\u653e\u7f6e\u5230\u8fd9\u4e9b\u76ee\u5f55\u4e4b\u4e2d\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2aWeb\u5de5\u7a0b\u7684\u76ee\u5f55\u6620\u5c04\u56fe\u8868\u793a\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-324.png\" alt=\"\" class=\"wp-image-10259\" width=\"495\" height=\"307\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324.png 938w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-300x186.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-768x477.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-830x515.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-230x143.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-350x217.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-324-480x298.png 480w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/figure><\/div>\n\n\n\n<p>\u4ece\u4e0a\u56fe\u53ef\u77e5\uff0c\u4e00\u4e2aWeb\u5de5\u7a0b\uff0c\u6700\u7ec8\u751f\u6210\u7684\u7f16\u8bd1\u7ed3\u8fc7\uff0c\u4ee5\u9879\u76ee\u540dChicken\u4e3a\u6839\u76ee\u5f55\uff0c\u6240\u6709\u7684\u6e90\u6587\u4ef6<br>\u5bf9\u5e94\u7684.class\u6587\u4ef6\uff0c\u4f1a\u88ab\u653e\u7f6eWEB-INF\/classes\u6587\u4ef6\u4e2d\uff08\u7531\u4e8eWeb\u7a0b\u5e8f\u662f\u88ab\u90e8\u7f72\u5230Web\u5bb9\u5668\u4e2d\uff0c\u6240\u4ee5\u9879\u76ee\u7684\u3002classes\u6587\u4ef6\u5fc5\u987b\u88ab\u653e\u7f6e\u5728WEB-INF\/classes\u4e2d\u3002\u53ef\u901a\u8fc7 Project Structure\u6765\u8bbe\u7f6e.class\u6587\u4ef6\u7684\u4f4d\u7f6e\uff09\u3002\u5b9e\u9645\u4e0a\uff0c\u6e90\u6587\u4ef6\u4e2d\u7684Resources\u6587\u4ef6\u4e5f\u4f1a\u88ab\u6620\u5c04\u5230WEB-INF\/classes\u6587\u4ef6\u3002<\/p>\n\n\n\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><br>\u5bf9\u4e8eweb\u5de5\u7a0b\uff0cclasspath:\u5b9e\u9645\u4e0a\u6307\u7684\u662f\/WEB-INF\/classes\u76ee\u5f55!<\/p>\n\n\n\n<ul><li>classpath\u5bf9\u5e94\u6e90\u7a0b\u5e8f\u4e2d\u7684src\u6587\u4ef6\u5939\u548cresources\u6587\u4ef6\u5939\u3002<\/li><\/ul>\n\n\n\n<p>\u5bf9\u4e8e\u666e\u901aJava\u9879\u76ee\uff0cclasspath:\u5b9e\u9645\u4e0a\u6307\u7684\u662f\/target\/classes\u76ee\u5f55!<\/p>\n\n\n\n<ul><li>classpath\u5bf9\u5e94\u6e90\u7a0b\u5e8f\u4e2d\u7684src\u6587\u4ef6\u5939\u3002<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5f15\u8a00 \u5728Java\u7f16\u7a0b\u7684\u8fc7\u7a0b\u4e2d\uff0c\u7ecf\u5e38\u6d89\u53ca\u5230\u5bf9\u672c\u5730\u8d44\u6e90\u7684\u8bfb\u53d6\u3002\u6bd4\u5982\uff0cSSM\u6846\u67b6\u4e2d\uff0c\u901a\u8fc7Spring\u6846\u67b6\u9700\u8981\u8bfb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10254"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10254"}],"version-history":[{"count":2,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10254\/revisions"}],"predecessor-version":[{"id":10261,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10254\/revisions\/10261"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}