exe4j使ç¨æ¹æ³ï¼
å°javaç¼ç»æ.classålassåï¼å¦æåªæ¯ç¨javaå½ä»¤æ¥æ§è¡æ»è§å¾ä¸æ¯å¤ªè¿ç¾ï¼æ¾ä¸ªåæ³çæåexeæ件ä¸æ ·ç¨é¼ æ åå»ä¾¿å¯æ§è¡çæ件ï¼åºè¯¥æ¯å¾æ趣çåãè¿éæç¨äºä¸ä¸ªååå«åexe4jçå
è´¹å°è½¯ä»¶ï¼æè§ä¸éã
ããé¦å
ï¼å½ç¶æ¯è¦ä¸è½½ä¸ªexe4jãæçæ¯2.2çæ¬çï¼licenseï¼L-g782dn2d-1f1yqxx1rv1sqdã
ããæ¥çï¼å°ä½ è¦éæ©å¥½ä½ å³å°åå¸ç.classæ件就ä¸ç¨ç»è¯´äºãä¸é¢æ¯å建jaræ件ï¼è¿éæç¨ä¸ä¸ªååå«åd:MyJavaTest.classç
æ件æ¥ä¸¾ä¾ï¼å¦å¤æ³¨æè¿è¦ç¼åä¸ä¸ªç¡®å®main_classçæ件manifest.mfï¼å¨è¿émainfest.mfåç®å½MyJavaæ¯å¨åä¸ä¸ªç®
å½ä¸ï¼è¿éæ¯é½å¨D:ï¼ï¼ç¶å使ç¨å¦ä¸å½ä»¤ï¼
jar cvfm test.jar manifest.mf MyJava
ããmanifest.mfå½åè¿ä¸ç¥éæä¹åï¼é常çæçãããåµåµãå
¶å®å¾ç®åï¼ä»£ç å¦ä¸ï¼
Manifest-Version: 1.0
Main-Class: MyJava.Test
Created-By: Hanic
ããåªè¦Main-Classå对就å¯ä»¥äºãè¿æ ·ï¼ä¸ä¸ªtest.jaræ件就çæäºï¼è¿éæå°±ä¸ç»è¯´jarçå
·ä½åè½äºãä½ä¸ºäºç¡®ä¿æåï¼æ们å¯ä»¥åç¨ä¸é¢çæ令æ§è¡ä¸ä¸ååçæçtest.jarï¼
java -jar test.jar
ããæä¹æ ·ï¼æ¯ä¸æ¯å¯ä»¥å¾é¡ºå©çè¿è¡ï¼å¦ææ¯ï¼é£æ们就å¯ä»¥å¼å§è¿è¡å¯æ§è¡æ件çå建äºã
ããexe4jåºç¨èµ·æ¥åæ¯ç¸å½ç®åã类似äºå»çå¼çï¼åªè¦ä¸è·¯nextï¼å¡«ååéæ©ä¸ªå«çåæ°å°±okäºãç¨å¾®æç¹eæçé½å¯ä»¥åºç¨èªå¦äºãä¸è¦è¯´ä½ ä¸ç¹eæé½ä¸æåï¼æ²¡åæ³ï¼ç®å说ä¸æµç¨ï¼
1ãæå¼exe4jï¼å¯ä»¥è¾å
¥licenseï¼å¯ä»¥æå¼ä½ 以åæä½è¿çconfigæ件ã
2ãåå»NEXTé®ï¼éæ©âJAR in EXEâmodæé®ï¼åå»NEXTã
3ãå¡«åçååæ件è¾åºçè·¯å¾ç¶åç¹å»NEXTã
4ãå¨è¿éä½ å¯ä»¥éæ©ä½ è¦çæçå¯æ§è¡æ件çç±»åï¼ä»¥åçæçå¯æ§è¡æ件å称ãå¯æ§è¡æ件çå¾æ çï¼æ们å¨è¿éå°±éæ©GUI applicationï¼ååå°±æ ¹æ®èªå·±çéè¦åä¸ä¸ªï¼å¾æ ä½ å¯ä»¥èªå·±å¨ä½ çå¾æ åºééä¸ä¸ªä½ å欢çï¼ç¶ååNEXTã
5ãå¨è¿éå¡«åMain classçååï¼åå»ç»¿è²+éæ©æéç.jaræ件,å¦æ没æç¹æ®è¦æ±æ们就å¯ä»¥å继ç»äºã
6ãæ¥ä¸æ¥æ¯éæ©çæ¬ï¼å¡«å好èªå·±çæ大æå°çæ¬ç¶åå继ç»ã
7ãä¸é¢è®¾ä¸ä¸ä½ çæ件æ§è¡çç头ï¼å¢å å
¶ç¾è§ææï¼éæ©èªå·±å欢çå¾çï¼åèªå·±æ³åçæåï¼å¹¶å¯ä»¥æ ¹æ®éè¦è°æ´æåçä½ç½®ï¼å继ç»ã
8ãä¸é¢æ¯ä¸ä¸ªéæ©è¯è¨çæ¬ççé¢é好åå继ç»ã
9ãä¸é¢æ¯ä¸ä¸ªçæççå¾
ï¼ç¶å就大ååæäºï¼ä¸ä¸ªjavaåæçå¯æ§è¡æ件就è¿æ ·çæäºã
温馨提示:内容为网友见解,仅供参考