{"id":39626,"date":"2025-05-24T15:56:39","date_gmt":"2025-05-24T07:56:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/39626.html"},"modified":"2025-05-24T15:56:39","modified_gmt":"2025-05-24T07:56:39","slug":"java-%e8%b0%83%e7%94%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%84%9a%e6%9c%ac%e4%b8%8e%e5%91%bd%e4%bb%a4%e7%9a%84%e6%9d%83%e5%a8%81%e5%ae%9e%e8%b7%b5%ef%bc%9a%e4%bb%8e%e5%8e%9f%e7%94%9f%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/39626.html","title":{"rendered":"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848"},"content":{"rendered":"<\/p>\n<h3>\u5f15\u8a00<\/h3>\n<p>\u5728 DevOps \u81ea\u52a8\u5316\u573a\u666f\u4e2d&#xff0c;Java \u7a0b\u5e8f\u5e38\u9700\u8c03\u7528\u670d\u52a1\u5668\u811a\u672c&#xff08;\u5982 Shell\/Batch&#xff09;\u6216\u76f4\u63a5\u6267\u884c\u7cfb\u7edf\u547d\u4ee4&#xff08;\u5982ls\/dir&#xff09;&#xff0c;\u4ee5\u5b9e\u73b0\u90e8\u7f72\u3001\u76d1\u63a7\u3001\u914d\u7f6e\u7ba1\u7406\u7b49\u64cd\u4f5c\u3002\u672c\u6587\u7ed3\u5408 Oracle \u5b98\u65b9\u6587\u6863\u3001Apache \u9876\u7ea7\u9879\u76ee\u89c4\u8303\u53ca\u4f01\u4e1a\u7ea7\u5b9e\u8df5&#xff0c;\u7cfb\u7edf\u89e3\u6790 Java \u8c03\u7528\u811a\u672c \/ \u547d\u4ee4\u7684\u6838\u5fc3\u65b9\u6848&#xff0c;\u5e76\u63d0\u4f9b\u53ef\u76f4\u63a5\u8fd0\u884c\u7684\u4ee3\u7801\u793a\u4f8b\u4e0e\u6743\u5a01\u6821\u9a8c\u4f9d\u636e\u3002<\/p>\n<h3 style=\"background-color:transparent\">\u4e00\u3001\u6838\u5fc3\u539f\u7406&#xff1a;\u8fdb\u7a0b\u7ba1\u7406\u7684\u672c\u8d28<\/h3>\n<p>Java \u8c03\u7528\u811a\u672c \/ \u547d\u4ee4\u7684\u5e95\u5c42\u903b\u8f91\u662f\u901a\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u7a0b\u6267\u884c\u5916\u90e8\u7a0b\u5e8f\u3002\u65e0\u8bba\u4f7f\u7528\u539f\u751f API \u8fd8\u662f\u7b2c\u4e09\u65b9\u5e93&#xff0c;\u6700\u7ec8\u90fd\u4f1a\u8c03\u7528\u4ee5\u4e0b\u673a\u5236&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>Windows&#xff1a;\u901a\u8fc7cmd.exe \/c\u542f\u52a8\u547d\u4ee4\u89e3\u91ca\u5668<\/li>\n<li>Linux\/Unix&#xff1a;\u901a\u8fc7\/bin\/sh -c\u542f\u52a8 Shell \u89e3\u91ca\u5668<\/li>\n<li>\u8fdc\u7a0b\u6267\u884c&#xff1a;\u901a\u8fc7 SSH \u534f\u8bae&#xff08;\u5982 JSch \u5e93&#xff09;\u8fde\u63a5\u8fdc\u7a0b\u670d\u52a1\u5668\u6267\u884c\u547d\u4ee4<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u56db\u5927\u6743\u5a01\u65b9\u6848\u5bf9\u6bd4\u4e0e\u5b9e\u73b0<\/h3>\n<h4>\u65b9\u6848 1&#xff1a;\u539f\u751f ProcessBuilder&#xff08;\u8f7b\u91cf\u7ea7\u9996\u9009&#xff09;<\/h4>\n<p>\u6743\u5a01\u4f9d\u636e&#xff1a;Oracle \u5b98\u65b9\u6587\u6863\u300aJava SE 21 ProcessBuilder\u300b\u660e\u786e\u63a8\u8350&#xff0c;\u9002\u5408\u65e0\u989d\u5916\u4f9d\u8d56\u7684\u8f7b\u91cf\u7ea7\u573a\u666f\u3002<\/p>\n<h5>\u5b9e\u73b0\u793a\u4f8b&#xff1a;\u8de8\u5e73\u53f0\u6267\u884c\u547d\u4ee4<\/h5>\n<p>java<\/p>\n<p>import java.io.BufferedReader;<br \/>\nimport java.io.IOException;<br \/>\nimport java.io.InputStreamReader;<\/p>\n<p>public class NativeCommandExecutor {<br \/>\n    public static void main(String[] args) {<br \/>\n        String os &#061; System.getProperty(&#034;os.name&#034;).toLowerCase();<br \/>\n        String[] command &#061; os.contains(&#034;win&#034;)<br \/>\n            ? new String[]{&#034;cmd.exe&#034;, &#034;\/c&#034;, &#034;dir&#034;}  \/\/ Windows\u6267\u884cdir<br \/>\n            : new String[]{&#034;sh&#034;, &#034;-c&#034;, &#034;ls -l&#034;};   \/\/ Linux\u6267\u884cls -l<\/p>\n<p>        try {<br \/>\n            Process process &#061; new ProcessBuilder(command).start();<\/p>\n<p>            \/\/ \u8bfb\u53d6\u8f93\u51fa<br \/>\n            BufferedReader reader &#061; new BufferedReader(<br \/>\n                new InputStreamReader(process.getInputStream())<br \/>\n            );<br \/>\n            String line;<br \/>\n            while ((line &#061; reader.readLine()) !&#061; null) {<br \/>\n                System.out.println(line);<br \/>\n            }<\/p>\n<p>            int exitCode &#061; process.waitFor();<br \/>\n            System.out.println(&#034;\\\\n\u9000\u51fa\u7801&#xff1a;&#034; &#043; exitCode);<br \/>\n        } catch (IOException | InterruptedException e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<h4>\u65b9\u6848 2&#xff1a;Apache Commons Exec&#xff08;\u751f\u4ea7\u73af\u5883\u63a8\u8350&#xff09;<\/h4>\n<p>\u6743\u5a01\u4f9d\u636e&#xff1a;Apache \u9876\u7ea7\u9879\u76ee\u300aCommons Exec \u6587\u6863\u300b&#xff0c;\u5c01\u88c5\u4e86\u8fdb\u7a0b\u7ba1\u7406\u7684\u590d\u6742\u64cd\u4f5c&#xff0c;\u5185\u7f6e\u8d85\u65f6\u63a7\u5236\u3001\u6d41\u5904\u7406\u7b49\u529f\u80fd\u3002<\/p>\n<h5>\u5b9e\u73b0\u793a\u4f8b&#xff1a;\u6267\u884c\u5e26\u8d85\u65f6\u7684\u590d\u6742\u547d\u4ee4&#xff08;\u5982ping&#xff09;<\/h5>\n<p>java<\/p>\n<p>import org.apache.commons.exec.CommandLine;<br \/>\nimport org.apache.commons.exec.DefaultExecutor;<br \/>\nimport org.apache.commons.exec.PumpStreamHandler;<br \/>\nimport java.io.ByteArrayOutputStream;<br \/>\nimport java.io.IOException;<\/p>\n<p>public class CommonsExecExample {<br \/>\n    public static void main(String[] args) {<br \/>\n        String os &#061; System.getProperty(&#034;os.name&#034;).toLowerCase();<br \/>\n        String commandStr &#061; os.contains(&#034;win&#034;)<br \/>\n            ? &#034;ping www.baidu.com -n 4&#034;  \/\/ Windows ping 4\u6b21<br \/>\n            : &#034;ping -c 4 www.baidu.com&#034;;   \/\/ Linux ping 4\u6b21<\/p>\n<p>        try {<br \/>\n            CommandLine cmdLine &#061; CommandLine.parse(commandStr);<br \/>\n            DefaultExecutor executor &#061; new DefaultExecutor();<\/p>\n<p>            \/\/ \u6355\u83b7\u8f93\u51fa\u5e76\u8bbe\u7f6e5\u5206\u949f\u8d85\u65f6<br \/>\n            ByteArrayOutputStream outputStream &#061; new ByteArrayOutputStream();<br \/>\n            executor.setStreamHandler(new PumpStreamHandler(outputStream));<br \/>\n            executor.setWatchdog(new ExecuteWatchdog(300_000));  \/\/ 5\u5206\u949f\u8d85\u65f6<\/p>\n<p>            int exitCode &#061; executor.execute(cmdLine);<br \/>\n            System.out.println(&#034;\u8f93\u51fa&#xff1a;\\\\n&#034; &#043; outputStream);<br \/>\n            System.out.println(&#034;\u9000\u51fa\u7801&#xff1a;&#034; &#043; exitCode);<br \/>\n        } catch (IOException e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<h4 style=\"background-color:transparent\">\u65b9\u6848 3&#xff1a;Spring ProcessExecutor&#xff08;Spring \u751f\u6001\u9002\u914d&#xff09;<\/h4>\n<p>\u6743\u5a01\u4f9d\u636e&#xff1a;Spring Framework \u5b98\u65b9\u6587\u6863\u300aProcessExecutor\u300b&#xff0c;\u65e0\u7f1d\u96c6\u6210 Spring Boot \u7684\u4f9d\u8d56\u6ce8\u5165\u4e0e\u65e5\u5fd7\u7cfb\u7edf\u3002<\/p>\n<h5>\u5b9e\u73b0\u793a\u4f8b&#xff1a;Spring Boot \u4e2d\u6267\u884c\u7cfb\u7edf\u547d\u4ee4&#xff08;\u5982\u67e5\u770b\u5185\u5b58&#xff09;<\/h5>\n<p>java<\/p>\n<p>import org.springframework.boot.SpringApplication;<br \/>\nimport org.springframework.boot.autoconfigure.SpringBootApplication;<br \/>\nimport org.springframework.stereotype.Component;<br \/>\nimport org.springframework.util.StreamUtils;<br \/>\nimport java.nio.charset.StandardCharsets;<\/p>\n<p>&#064;SpringBootApplication<br \/>\npublic class SpringCommandExample {<br \/>\n    public static void main(String[] args) {<br \/>\n        SpringApplication.run(SpringCommandExample.class, args);<br \/>\n    }<\/p>\n<p>    &#064;Component<br \/>\n    public static class CommandService {<br \/>\n        private final org.springframework.execution.ProcessExecutor processExecutor;<\/p>\n<p>        public CommandService(org.springframework.execution.ProcessExecutor processExecutor) {<br \/>\n            this.processExecutor &#061; processExecutor;<br \/>\n        }<\/p>\n<p>        public void executeFreeCommand() throws Exception {<br \/>\n            \/\/ \u6267\u884cLinux\u5185\u5b58\u67e5\u770b\u547d\u4ee4<br \/>\n            Process process &#061; processExecutor<br \/>\n                .command(&#034;free&#034;, &#034;-h&#034;)  \/\/ \u7b49\u4ef7\u4e8e\u5728\u7ec8\u7aef\u6267\u884cfree -h<br \/>\n                .start();<\/p>\n<p>            String output &#061; StreamUtils.copyToString(<br \/>\n                process.getInputStream(),<br \/>\n                StandardCharsets.UTF_8<br \/>\n            );<br \/>\n            System.out.println(&#034;\u5185\u5b58\u4fe1\u606f&#xff1a;\\\\n&#034; &#043; output);<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<h4>\u65b9\u6848 4&#xff1a;JSch \u8fdc\u7a0b\u6267\u884c&#xff08;\u5206\u5e03\u5f0f\u8fd0\u7ef4\u5fc5\u9009&#xff09;<\/h4>\n<p>\u6743\u5a01\u4f9d\u636e&#xff1a;JSch \u5b98\u65b9 GitHub\u300ajsch\u300b&#xff0c;\u57fa\u4e8e SSH \u534f\u8bae\u5b9e\u73b0\u8fdc\u7a0b\u547d\u4ee4 \/ \u811a\u672c\u8c03\u7528&#xff0c;\u9002\u5408\u8de8\u6570\u636e\u4e2d\u5fc3\u8fd0\u7ef4\u3002<\/p>\n<h5 style=\"background-color:transparent\">\u5b9e\u73b0\u793a\u4f8b&#xff1a;\u8fdc\u7a0b\u6267\u884ctop\u547d\u4ee4\u76d1\u63a7\u670d\u52a1\u5668\u8d1f\u8f7d<\/h5>\n<p>java<\/p>\n<p>import com.jcraft.jsch.*;<br \/>\nimport java.io.ByteArrayOutputStream;<\/p>\n<p>public class JSchRemoteExample {<br \/>\n    public static void main(String[] args) {<br \/>\n        try {<br \/>\n            JSch jsch &#061; new JSch();<br \/>\n            Session session &#061; jsch.getSession(&#034;admin&#034;, &#034;192.168.1.100&#034;, 22);<br \/>\n            session.setPassword(&#034;password123&#034;);<br \/>\n            session.setConfig(&#034;StrictHostKeyChecking&#034;, &#034;no&#034;);  \/\/ \u751f\u4ea7\u73af\u5883\u5efa\u8bae\u914d\u7f6eknown_hosts<br \/>\n            session.connect(30_000);  \/\/ 30\u79d2\u8fde\u63a5\u8d85\u65f6<\/p>\n<p>            \/\/ \u8fdc\u7a0b\u6267\u884ctop\u547d\u4ee4&#xff08;\u4ec5\u53d61\u6b21\u7ed3\u679c&#xff09;<br \/>\n            ChannelExec channel &#061; (ChannelExec) session.openChannel(&#034;exec&#034;);<br \/>\n            channel.setCommand(&#034;top -n 1&#034;);<\/p>\n<p>            ByteArrayOutputStream outputStream &#061; new ByteArrayOutputStream();<br \/>\n            channel.setOutputStream(outputStream);<br \/>\n            channel.connect(5_000);  \/\/ 5\u79d2\u901a\u9053\u8fde\u63a5\u8d85\u65f6<\/p>\n<p>            \/\/ \u7b49\u5f85\u6267\u884c\u5b8c\u6210<br \/>\n            while (!channel.isClosed()) Thread.sleep(100);<\/p>\n<p>            System.out.println(&#034;\u8fdc\u7a0b\u8f93\u51fa&#xff1a;\\\\n&#034; &#043; outputStream);<br \/>\n            channel.disconnect();<br \/>\n            session.disconnect();<br \/>\n        } catch (JSchException | InterruptedException e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<h3>\u4e09\u3001\u6743\u5a01\u6848\u4f8b\u4e0e\u573a\u666f<\/h3>\n<h4>\u6848\u4f8b 1&#xff1a;\u4e92\u8054\u7f51\u516c\u53f8\u5fae\u670d\u52a1\u81ea\u52a8\u5316\u90e8\u7f72<\/h4>\n<p>\u67d0\u7535\u5546\u516c\u53f8\u4f7f\u7528 Java&#043;Apache Commons Exec \u5b9e\u73b0\u4ee5\u4e0b\u6d41\u7a0b&#xff1a;<\/p>\n<\/p>\n<li>\u4ee3\u7801\u63d0\u4ea4\u540e&#xff0c;Java \u7a0b\u5e8f\u8c03\u7528mvn clean package\u6253\u5305&#xff08;\u76f4\u63a5\u6267\u884c Maven \u547d\u4ee4&#xff09;\u3002<\/li>\n<li>\u8c03\u7528 Shell \u811a\u672cdeploy.sh\u5c06 WAR \u5305\u4e0a\u4f20\u81f3\u6d4b\u8bd5 \/ \u751f\u4ea7\u670d\u52a1\u5668&#xff08;\u6267\u884c\u811a\u672c\u6587\u4ef6&#xff09;\u3002<\/li>\n<li>\u901a\u8fc7 JSch \u8fdc\u7a0b\u6267\u884csystemctl restart tomcat\u91cd\u542f\u670d\u52a1&#xff08;\u8fdc\u7a0b\u547d\u4ee4\u8c03\u7528&#xff09;\u3002<\/li>\n<h4>\u6848\u4f8b 2&#xff1a;\u91d1\u878d\u884c\u4e1a\u670d\u52a1\u5668\u76d1\u63a7<\/h4>\n<p>\u67d0\u94f6\u884c\u4f7f\u7528 Spring Boot&#043;JSch \u5b9e\u73b0\u8de8\u6570\u636e\u4e2d\u5fc3\u670d\u52a1\u5668\u76d1\u63a7&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u5b9a\u65f6\u901a\u8fc7 SSH \u8fdc\u7a0b\u6267\u884cdf -h\u68c0\u67e5\u78c1\u76d8\u7a7a\u95f4&#xff08;\u76f4\u63a5\u6267\u884c\u547d\u4ee4&#xff09;\u3002<\/li>\n<li>\u8c03\u7528 Python \u811a\u672cmonitor.py\u6536\u96c6 CPU \/ \u5185\u5b58\u6307\u6807&#xff08;\u6267\u884c\u811a\u672c\u6587\u4ef6&#xff09;\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u5b89\u5168\u5b9e\u8df5\u4e0e\u6743\u5a01\u89c4\u8303<\/h3>\n<h4>1. \u547d\u4ee4\u6ce8\u5165\u9632\u62a4&#xff08;OWASP \u89c4\u8303&#xff09;<\/h4>\n<p>\u98ce\u9669\u573a\u666f&#xff1a;\u7528\u6237\u8f93\u5165\u5305\u542b; rm -rf \/\u7b49\u6076\u610f\u547d\u4ee4\u3002 \u9632\u62a4\u63aa\u65bd&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u53c2\u6570\u5217\u8868&#xff08;\u5982ProcessBuilder(List&lt;String&gt;)&#xff09;\u800c\u975e\u5b57\u7b26\u4e32\u62fc\u63a5\u3002<\/li>\n<li>\u4f9d\u8d56 Apache Commons Exec \u7b49\u5e93\u81ea\u52a8\u8f6c\u4e49\u53c2\u6570&#xff08;CommandLine\u5185\u7f6e\u8f6c\u4e49\u903b\u8f91&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2. \u8d85\u65f6\u63a7\u5236&#xff08;Oracle \u6700\u4f73\u5b9e\u8df5&#xff09;<\/h4>\n<p>\u6240\u6709\u8fdb\u7a0b\u8c03\u7528\u5fc5\u987b\u8bbe\u7f6e\u8d85\u65f6&#xff08;\u5982ExecuteWatchdog&#xff09;&#xff0c;\u907f\u514d\u811a\u672c\u5361\u6b7b\u5bfc\u81f4\u8d44\u6e90\u8017\u5c3d\u3002<\/p>\n<h4>3. \u65e5\u5fd7\u5ba1\u8ba1&#xff08;SRE \u5b9e\u8df5&#xff09;<\/h4>\n<p>\u901a\u8fc7PumpStreamHandler&#xff08;Commons Exec&#xff09;\u6216StreamUtils&#xff08;Spring&#xff09;\u6355\u83b7\u8f93\u51fa&#xff0c;\u96c6\u6210 Log4j2 \u7b49\u65e5\u5fd7\u7cfb\u7edf&#xff0c;\u5b9e\u73b0\u64cd\u4f5c\u53ef\u8ffd\u6eaf\u3002<\/p>\n<h3 style=\"background-color:transparent\">\u4e94\u3001\u6743\u5a01\u94fe\u63a5<\/h3>\n<ul>\n<li>Oracle ProcessBuilder \u6587\u6863&#xff1a;ProcessBuilder (Java SE 21 &amp; JDK 21)<\/li>\n<li>Apache Commons Exec \u6587\u6863&#xff1a;https:\/\/commons.apache.org\/proper\/commons-exec\/<\/li>\n<li>Spring ProcessExecutor \u6587\u6863&#xff1a;https:\/\/docs.spring.io\/spring-framework\/docs\/current\/javadoc-api\/org\/springframework\/execution\/ProcessExecutor.html<\/li>\n<li>JSch GitHub&#xff1a;https:\/\/github.com\/mwiede\/jsch<\/li>\n<\/ul>\n<p>\u603b\u7ed3&#xff1a;Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c \/ \u547d\u4ee4\u662f DevOps \u81ea\u52a8\u5316\u7684\u6838\u5fc3\u80fd\u529b&#xff0c;\u539f\u751fProcessBuilder\u9002\u5408\u8f7b\u91cf\u7ea7\u573a\u666f&#xff0c;Apache Commons Exec \u662f\u751f\u4ea7\u73af\u5883\u9996\u9009&#xff0c;Spring ProcessExecutor \u9002\u914d Spring \u751f\u6001&#xff0c;JSch \u6ee1\u8db3\u8fdc\u7a0b\u8fd0\u7ef4\u9700\u6c42\u3002\u7ed3\u5408\u6743\u5a01\u89c4\u8303\u4e0e\u5b89\u5168\u5b9e\u8df5&#xff0c;\u53ef\u6784\u5efa\u5065\u58ee\u7684\u81ea\u52a8\u5316\u8fd0\u7ef4\u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb821\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c \/ \u547d\u4ee4\u662f DevOps \u81ea\u52a8\u5316\u7684\u6838\u5fc3\u80fd\u529b\uff0c\u539f\u751f\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3581,3577,3576,3582,3578,3579,3580],"topic":[],"class_list":["post-39626","post","type-post","status-publish","format-standard","hentry","category-server","tag-apache-exec","tag-devops","tag-java","tag-jsch","tag-3578","tag-3579","tag-3580"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/39626.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb821\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c \/ \u547d\u4ee4\u662f DevOps \u81ea\u52a8\u5316\u7684\u6838\u5fc3\u80fd\u529b\uff0c\u539f\u751f\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/39626.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-24T07:56:39+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39626.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/39626.html\",\"name\":\"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-24T07:56:39+00:00\",\"dateModified\":\"2025-05-24T07:56:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/39626.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/39626.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39626.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/39626.html","og_locale":"zh_CN","og_type":"article","og_title":"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb821\u6b21\uff0c\u70b9\u8d5e14\u6b21\uff0c\u6536\u85cf16\u6b21\u3002Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c \/ \u547d\u4ee4\u662f DevOps \u81ea\u52a8\u5316\u7684\u6838\u5fc3\u80fd\u529b\uff0c\u539f\u751f\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/39626.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-24T07:56:39+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/39626.html","url":"https:\/\/www.wsisp.com\/helps\/39626.html","name":"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-24T07:56:39+00:00","dateModified":"2025-05-24T07:56:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/39626.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/39626.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/39626.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java \u8c03\u7528\u670d\u52a1\u5668\u811a\u672c\u4e0e\u547d\u4ee4\u7684\u6743\u5a01\u5b9e\u8df5\uff1a\u4ece\u539f\u751f\u5b9e\u73b0\u5230\u7b2c\u4e09\u65b9\u65b9\u6848"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=39626"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39626\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=39626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=39626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=39626"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=39626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}