{"id":6162,"date":"2024-08-17T15:01:03","date_gmt":"2024-08-17T07:01:03","guid":{"rendered":""},"modified":"2024-08-17T15:01:03","modified_gmt":"2024-08-17T07:01:03","slug":"java\u548ceclipse\u7684\u5b89\u88c5_202203","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6162.html","title":{"rendered":"java\u548ceclipse\u7684\u5b89\u88c5_202203"},"content":{"rendered":"

\u5148\u88c5JDK\u518d\u88c5Eclipse\u3002<\/h3>\n

\uff081\uff09JDK\u7684\u4e0b\u8f7d\u3001\u5b89\u88c5\u53ca\u914d\u7f6e<\/h3>\n

\u94fe\u63a5\u5982\u4e0b\uff1a<\/p>\n

Java SE | Oracle Technology Network | Oraclehttps:\/\/www.oracle.com\/java\/technologies\/java-se-glance.html\u6ce8\u610f\uff1a\u514d\u8d39\u521b\u5efaOracle\u8d26\u6237\u5e76\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u4e0b\u8f7d\u3002<\/p>\n

\u9009\u62e9Java 8\u2014\u2014Windows\u2014\u2014x64\u7248\u672c\u3002<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u5b89\u88c5\u5373\u53ef\uff0c\u5efa\u8bae\u5b89\u88c5\u5728C\u76d8<\/span>\uff0c\u65b9\u4fbf\u4ee5\u540e\u7684\u4f7f\u7528\u548c\u5404\u79cd\u5de5\u5177\u7684\u67e5\u627e\u3002<\/p>\n

        \u6211\u7684\u5b89\u88c5\u8def\u5f84\uff1aC:\\Program Files\\Java<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

jdk1.8.0_321\u76ee\u5f55<\/span>\u4e0b\u7684\u6587\u4ef6\u8bf4\u660e\uff1a<\/p>\n

        \uff081\uff09bin\u6587\u4ef6\u5939\u4e2d\u5b58\u653e\u4e00\u4e9b\u53ef\u6267\u884c\u7a0b\u5e8f
        \u5982javac.exe\uff08Java\u7f16\u8bd1\u5668\uff09\u3001java.exe\uff08Java\u8fd0\u884c\u5de5\u5177\uff09
        jar.exe\uff08\u6253\u5305\u5de5\u5177\uff09\u3001javadoc.exe\uff08\u6587\u6863\u751f\u6210\u5de5\u5177\uff09<\/p>\n

        \uff082\uff09include\u6587\u4ef6\u5939\u5b58\u653e\u4e00\u4e9bC\u8bed\u8a00\u5934\u6587\u4ef6\u3002\u56e0\u4e3aJava\u662f\u7528C\/C++\u5f00\u53d1\u7684\u3002<\/p>\n

        \uff083\uff09jre\u662fJava Runtime Environment\u7684\u7f29\u5199\uff0c\u662fJava\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u73af\u5883\u3002\u8be5\u76ee\u5f55\u4e0b\u5305\u542bJava\u865a\u62df\u673a\u3001\u8fd0\u884c\u65f6\u7684\u7c7b\u5305\u3001Java\u5e94\u7528\u542f\u52a8\u5668\u548cbin\u76ee\u5f55\uff0c\u4e0d\u5305\u542b\u5f00\u53d1\u73af\u5883\u4e2d\u7684\u5f00\u53d1\u5de5\u5177\u3002<\/p>\n

        \uff084\uff09lib\u662fJava\u7c7b\u5e93\u6216\u5e93\u6587\u4ef6\uff08library\uff09\uff0c\u662f\u5f00\u53d1\u5de5\u5177\u4f7f\u7528\u7684\u5f52\u6863\u5305\u6587\u4ef6\u3002<\/p>\n<\/p>\n

jdk1.8.0_321\u6587\u4ef6\u5939\u4e2d\u7684bin\u6587\u4ef6\u5939<\/span>\uff0c\u4f1a\u770b\u5230java.exe\u548cjavac.exe\u6587\u4ef6\uff08\u8fd8\u8981\u4e00\u5927\u5806\u5176\u4ed6\u6587\u4ef6\uff09\u3002<\/p>\n

        javac.exe<\/span>\u662f\u5c06.java\u6e90\u7a0b\u5e8f<\/span>\u7f16\u8bd1\u6210.class\u5b57\u8282\u6587\u4ef6<\/span><\/p>\n

        java.exe<\/span>\u662f\u6267\u884cJava\u5b57\u8282\u6587\u4ef6<\/span>\u7684\u7a0b\u5e8f<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u63a5\u4e0b\u6765\u8981\u914d\u7f6epath\u548cclasspath\u4e24\u4e2a\u7cfb\u7edf\u73af\u5883\u53d8\u91cf<\/span>\uff1a<\/p>\n

        path\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u4fdd\u5b58\u4e00\u7cfb\u5217\u547d\u4ee4\uff08<\/span>\u53ef\u6267\u884c\u7a0b\u5e8f<\/span>\uff09\u7684\u8def\u5f84<\/span>\uff0c\u6bcf\u4e2a\u8def\u5f84\u4e4b\u95f4\u7528\u5206\u53f7;\u5206\u9694\u3002\u5f53\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u8fd0\u884c\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u65f6\uff0c\u64cd\u4f5c\u7cfb\u7edf\u9996\u5148\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u67e5\u627e\u662f\u5426\u5b58\u5728\u8be5\u6587\u4ef6\uff0c\u5982\u679c\u672a\u627e\u5230\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u7ee7\u7eed\u5728path\u73af\u5883\u53d8\u91cf\u4e2d\u5b9a\u4e49\u7684\u8def\u5f84\u4e0b\u5bfb\u627e\u8fd9\u4e2a\u6587\u4ef6\uff0c\u5982\u679c\u4ecd\u672a\u627e\u5230\uff0c\u7cfb\u7edf\u4f1a\u62a5\u9519\u3002\uff08\u5982\uff1ajavac\u4e0d\u662f\u5185\u90e8\u6216\u5916\u90e8\u547d\u4ee4\uff0c\u4e5f\u4e0d\u662f\u53ef\u8fd0\u884c\u7684\u7a0b\u5e8f\uff09<\/p>\n

        classpath\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u4fdd\u5b58\u4e00\u7cfb\u5217<\/span>\u7c7b<\/span>\u7684\u8def\u5f84<\/span>\u6216\u8005\u6807\u51c6\u7c7b\u5305\u7684\u8def\u5f84\uff08\u5982<\/span>dt.jar<\/span>\u548c<\/span>tools.jar<\/span>\uff09<\/span>\u3002\u5f53Java\u865a\u62df\u673a\u9700\u8981\u8fd0\u884c\u4e00\u4e2a\u7c7b\u65f6\uff0c\u4f1a\u5728classpath\u73af\u5883\u53d8\u91cf\u5b9a\u4e49\u7684\u8def\u5f84\u4e0b\u5bfb\u627e\u6240\u9700\u7684*.class\u6587\u4ef6\u548c\u7c7b\u5305\u3002<\/p>\n

\uff081\uff09\u914d\u7f6e\u7cfb\u7edf\u53d8\u91cfPath\uff1a\u8ba1\u7b97\u673a\u53f3\u51fb--\u5c5e\u6027--\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u9ad8\u7ea7--\u73af\u5883\u53d8\u91cf--Path--\u7f16\u8f91--<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u5217\u8868\u4e2d\u67e5\u627e\u5230\u201cPath\u201d\uff0c\u5355\u51fb\u201c\u7f16\u8f91\u201d\uff0c\u5728\u5bf9\u5e94\u7684\u201c\u53d8\u91cf\u503c\u201d\u6846\u4e2d\u672b\u5c3e\u6dfb\u52a0\u201c;C:\\Program Files\\Java\\jdk1.8.0_321\\bin;C:\\Program Files\\Java\\jre1.8.0_321\\bin;\u201d\u3002<\/p>\n

\u76ee\u7684\u662f\u914d\u7f6e\u597d\u540e\u80fd\u591f\u8ba9\u6211\u4eec\u5728\u7cfb\u7edf\u4e2d\u7684\u4efb\u4f55\u5730\u65b9\u8fd0\u884cjava\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n

\u65b0\u5efa--\u6dfb\u52a0\u8def\u5f84--\u786e\u5b9a\uff01<\/p>\n

\u8def\u5f841\uff1aC:\\Program Files\\Java\\jdk<\/span>1.8.0_321\\bin<\/p>\n

\u8def\u5f842\uff1aC:\\Program Files\\Java\\jre<\/span>1.8.0_321\\bin<\/p>\n<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\uff082.1\uff09\u5355\u51fb\u201c\u7528\u6237\u53d8\u91cf<\/span>\u201d\u4e2d\u7684\u201c\u65b0\u5efa\u201d\uff0c\u53d8\u91cf\u540d\u4e2d\u8f93\u5165\u201cJAVA_HOME\u201d\uff0c\u53d8\u91cf\u503c\u4e2d\u8f93\u5165\u201cC:\\Program Files\\Java\\jdk1.8.0_321\u201d\uff08\u5c31\u662fJava\u7684\u5b89\u88c5\u6587\u4ef6\u5939\uff09\u3002<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \uff082.2\uff09\u518d\u5728\u7cfb\u7edf\u53d8\u91cf\u4e2d\u65b0\u5efa\u5982\u4e0b\u53d8\u91cf\uff1a<\/p>\n

        \u53d8\u91cf\u540d\uff1aCLASSPATH<\/p>\n

        \u53d8\u91cf\u503c\uff1a;%JAVA_HOME%lib;%JAVA_HOME%lib\\tools.jar;<\/p>\n

\u76ee\u7684\u662f\u544a\u8bc9JDK\uff0c\u641c\u7d22.class\u65f6\u5148\u67e5\u627e\u5f53\u524d\u76ee\u5f55\u7684.class\u6587\u4ef6\u3002<\/p>\n

 \"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n<\/p>\n

 \u6700\u540e\uff0c\u547d\u4ee4\u884c\u68c0\u67e5JDK\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n

\u6ce8\u610f\uff1ajava -version\u548cjavac -version\u4e00\u5b9a\u8981\u4e00\u6837\uff0c\u7248\u672c\u4e0d\u4e00\u6837\u7684\u8bdd\u6709\u95ee\u9898\uff01\uff01\uff01<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \uff082\uff09java\u548cjavac\u547d\u4ee4\u884c\u7248\u672c\u4e0d\u4e00\u81f4\u600e\u4e48\u529e<\/h3>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a\u5220\u9664\u73af\u5883\u53d8\u91cf\u4e2d\u7684\u8fd9\u4e24\u90e8\u5206\u3002\u5220\u9664\u540e\u91cd\u542f\u8ba1\u7b97\u673a\u3002<\/p>\n

\u5220\u96641\uff09C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath<\/p>\n

\u5220\u96642\uff09C:\\Program Files\\Microsoft\\jdk-11.0.12.7-hotspot\\bin<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u91cd\u542f\u8ba1\u7b97\u673a\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u68c0\u67e5java -version\u548cjavac -version\u7684\u7248\u672c\u662f\u5426\u4e00\u81f4\u3002<\/p>\n<\/p>\n

\uff083\uff09Eclipse\u7684\u4e0b\u8f7d\u4e0e\u5b89\u88c5\u2014\u2014\u514d\u8d39\u7684Java\u5f00\u53d1\u5de5\u5177<\/h3>\n

\u4e0b\u8f7d\u94fe\u63a5\uff1aEclipse Downloads | The Eclipse FoundationThe Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 415 open source projects, including runtimes, tools and frameworks.https:\/\/www.eclipse.org\/downloads\/<\/p>\n

\u9009\u62e9for Enterprise Java and Web Developers\u8fd9\u4e2a\u4e0b\u8f7d\u3002<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \u4e0b\u8f7d\u89e3\u538b\u540e\uff0c\u53cc\u51fb\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\uff0c\u5c31OK\uff01<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \uff084\uff09\u5199\u7b2c\u4e00\u4e2aEclipse\u7a0b\u5e8f<\/h3>\n

\uff084.1\uff09\u5148\u521b\u5efaJava\u9879\u76ee\uff08Project\uff09\uff0c\u4e3a\u5176\u547d\u540d\uff08\u5982\uff1atest \u9879\u76ee\uff09<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\uff084.2\uff09\u9879\u76ee\u5efa\u7acb\u597d\u4e4b\u540e\uff0c\u53f3\u51fb<\/span>src\u6587\u4ef6\u5939\uff0c\u5728\u9879\u76ee\u4e0b\u521b\u5efa\u5305<\/span>\uff08Package\uff09\uff0c<\/span>\u4e3a\u5176\u547d\u540d\uff08\u5982\uff1atest \u5305\uff09\u2014\u2014\u2014\u2014Java\u4e2d\u7684\u5305\u662f\u4e13\u95e8\u7528\u6765\u5b58\u653e\u7c7b<\/span>\u7684\u3002Java\u6e90\u6587\u4ef6\u7684\u7b2c\u4e00\u884c\u662f\u5305\u7684\u58f0\u660e\u3002\u7a0b\u5e8f\u901a\u8fc7\u58f0\u660e\u5305\u7684\u65b9\u5f0f\u5bf9Java\u7c7b\u8fdb\u884c\u5206\u76ee\u5f55\u7ba1\u7406\u3002<\/p>\n

\uff084.3\uff09\u53f3\u51fb<\/span>\u5305\u540d\uff0c\u521b\u5efaJava\u7c7b<\/span><\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203 \u521b\u5efaJava\u7c7b\uff0c\u547d\u540d\uff0c\u6ce8\u610f\u540d\u5b57\u7684\u9996\u5b57\u6bcd\u5927\u5199\uff08\u5982Hello\uff09\u3002<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 Finish\u540e\uff0c\u751f\u6210\u5982\u4e0b\u754c\u9762\u6a21\u677f\uff1a<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \u547d\u4ee4\u7a97\u53e3\u8f93\u5165\u4ee5\u4e0b\u7a0b\u5e8f\uff1a<\/p>\n

public static void main(String[] args) {
\n
        System.out.println(\"Hello World!\");
    }<\/p>\n

\u7ed3\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

        Package Explorer\u5305\u8d44\u6e90\u7ba1\u7406\u5668     Outline \u5927\u7eb2\uff08\u663e\u793a\u7c7b\u7684\u7ed3\u6784\uff09     <\/p>\n

        Perspective \u900f\u89c6\u56fe   View \u89c6\u56fe<\/p>\n

\u540e\u8bb0\uff1a\u600e\u4e48\u53d1\u73b0java -version<\/span>\u548cjavac -version<\/span>\u7684\u7248\u672c\u4e0d\u4e00\u81f4\u7684\uff1f<\/p>\n

\u8fd0\u884c\u4ee3\u7801\u65f6\u62a5\u9519\uff1aError: A JNI error has occurred, please check your installation and try again<\/span><\/strong><\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u539f\u56e0\uff1ajava -verion \u548c javac -version \u7248\u672c\u4e0d\u4e00\u81f4 <\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a\uff081\uff09\u770b\u54ea\u91cc\u8fd8\u4f7f\u7528\u4e86java.exe\uff0c<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \uff082\uff09\u5220\u9664\u76f8\u5e94\u7684\u73af\u5883\u53d8\u91cf\uff08\u8ba1\u7b97\u673a\u53f3\u51fb\u5c5e\u6027\uff0c\u9ad8\u7ea7\uff0c\u73af\u5883\u53d8\u91cf\uff0c\u7cfb\u7edf\u53d8\u91cf\uff0cPath\uff0c\u7f16\u8f91\uff09<\/p>\n

\u5220\u9664\u524d\u4e24\u9879\uff0c\u53ea\u4fdd\u7559\u4e00\u4e2a\u6211\u4eec\u5b89\u88c5\u4f4d\u7f6e\u7684\u3002\u7136\u540e\u91cd\u542f\u8ba1\u7b97\u673a\u5c31OK\uff01<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u7136\u540e\u4ee3\u7801\u6587\u4ef6\u5c31\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u4e86\u3002<\/p>\n

javac.exe<\/span>\u662f\u5c06.java\u6e90\u7a0b\u5e8f<\/span>\u7f16\u8bd1\u6210.class\u5b57\u8282\u6587\u4ef6<\/span><\/p>\n

java.exe<\/span>\u662f\u6267\u884cJava\u5b57\u8282\u6587\u4ef6<\/span>\u7684\u7a0b\u5e8f<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

 \u6bd4\u539f\u6765\u591a\u751f\u6210\u4e86*.class\u6587\u4ef6<\/p>\n

\"java\u548ceclipse\u7684\u5b89\u88c5_202203<\/p>\n

\u5907\u6ce8\uff1a <\/p>\n

\u8bed\u53e5(1) javac<\/span> -encoding utf8 Exam1_13.java<\/p>\n

\u8bed\u53e5(2) java<\/span> Exam1_13<\/p>\n

javac.exe<\/span>\u662f\u5c06.java\u6e90\u7a0b\u5e8f<\/span>\u7f16\u8bd1\u6210.class\u5b57\u8282\u6587\u4ef6<\/span><\/p>\n

java.exe<\/span>\u662f\u6267\u884cJava\u5b57\u8282\u6587\u4ef6<\/span>\u7684\u7a0b\u5e8f<\/p>\n","protected":false},"excerpt":{"rendered":"java\u548ceclipse\u7684\u5b89\u88c5_\u5148\u88c5JDK\uff0c\u518d\u88c5Eclipse","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6162"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=6162"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6162\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=6162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=6162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=6162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}