{"id":55105,"date":"2002-05-10T16:00:00","date_gmt":"2002-05-10T08:00:00","guid":{"rendered":"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/?guid=10cea2c78ad2a202c13087aecec4dd0b"},"modified":"2002-05-10T16:00:00","modified_gmt":"2002-05-10T08:00:00","slug":"java-tip-127-see-jar-run","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/2002\/05\/10\/java-tip-127-see-jar-run\/","title":{"rendered":"Java Tip 127: See JAR run"},"content":{"rendered":"<article>\n<section class=\"page\">\n<p>You can easily package an application&#8217;s entire set of <a href=\"http:\/\/itteacheritfreelance.hk\/index.php\" title=\"\u672c\u7db1\u9801\u63d0\u4f9b\u4e00\u500b\u65b9\u4fbf\u7684\u5e73\u53f0, \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b , PHP\u88dc\u7fd2, HTML\u88dc\u7fd2, CSS\u88dc\u7fd2, JavaScript\u88dc\u7fd2, XML, Java\u88dc\u7fd2,Server\u88dc\u7fd2, MySQL\u88dc\u7fd2, \u4e2d\u5b78\u96fb\u8166\u79d1\u79c1\u4eba\u88dc\u7fd2, \u5728\u8077\u4eba\u58eb\u96fb\u8166\u63d0\u5347\u88dc\u7fd2,\u5c08\u696d\u8003\u8a66\u96fb\u8166 \u88dc\u7fd2,\u96fb\u8166\u5716\u50cf\u8a2d\u8a08\u96fb\u8166\u88dc\u7fd2, gra\">class<\/a>es and resources into a Java Archive (JAR). In fact, that is one goal of having jar files. Another is to let users easily execute the application stored in the archive. Why then are jar files second-<a href=\"http:\/\/itteacheritfreelance.hk\/index.php\" title=\"\u672c\u7db1\u9801\u63d0\u4f9b\u4e00\u500b\u65b9\u4fbf\u7684\u5e73\u53f0, \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b , PHP\u88dc\u7fd2, HTML\u88dc\u7fd2, CSS\u88dc\u7fd2, JavaScript\u88dc\u7fd2, XML, Java\u88dc\u7fd2,Server\u88dc\u7fd2, MySQL\u88dc\u7fd2, \u4e2d\u5b78\u96fb\u8166\u79d1\u79c1\u4eba\u88dc\u7fd2, \u5728\u8077\u4eba\u58eb\u96fb\u8166\u63d0\u5347\u88dc\u7fd2,\u5c08\u696d\u8003\u8a66\u96fb\u8166 \u88dc\u7fd2,\u96fb\u8166\u5716\u50cf\u8a2d\u8a08\u96fb\u8166\u88dc\u7fd2, gra\">class<\/a> citizens in the Java universe\u2014functioning only as archives\u2014when they can be first <a href=\"http:\/\/itteacheritfreelance.hk\/index.php\" title=\"\u672c\u7db1\u9801\u63d0\u4f9b\u4e00\u500b\u65b9\u4fbf\u7684\u5e73\u53f0, \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b , PHP\u88dc\u7fd2, HTML\u88dc\u7fd2, CSS\u88dc\u7fd2, JavaScript\u88dc\u7fd2, XML, Java\u88dc\u7fd2,Server\u88dc\u7fd2, MySQL\u88dc\u7fd2, \u4e2d\u5b78\u96fb\u8166\u79d1\u79c1\u4eba\u88dc\u7fd2, \u5728\u8077\u4eba\u58eb\u96fb\u8166\u63d0\u5347\u88dc\u7fd2,\u5c08\u696d\u8003\u8a66\u96fb\u8166 \u88dc\u7fd2,\u96fb\u8166\u5716\u50cf\u8a2d\u8a08\u96fb\u8166\u88dc\u7fd2, gra\">class<\/a>, right alongside native executables?<\/p>\n<p>To execute a jar file, you can use the<\/p>\n<p><code>java<\/code><\/p>\n<p> command&#8217;s<\/p>\n<p><nobr><code>-jar<\/code><\/nobr><\/p>\n<p> option. For example, say you have a runnable jar file called<\/p>\n<p><code>myjar.jar<\/code><\/p>\n<p>. Because the file is runnable, you can execute it like this:<\/p>\n<p class=\"jumpTag\"><a href=\"https:\/\/www.javaworld.com\/article\/2077492\/core-java\/java-tip-127--see-jar-run.html#jump\">To read this article in full, please click here<\/a><\/p>\n<\/section>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<article>\n<section>\n<p>You can easily package an application&#8217;s entire set of classes and resources into a Java Archive (JAR). In fact, that is one goal of having jar files. Another is to let users easily execute the application stored in the archive. Why then are jar files second-class citizens in the Java universe&mdash;functioning only as archives&mdash;when they can be first class, right alongside native executables?<\/p>\n<p>To execute a jar file, you can use the<\/p>\n<p><code>java<\/code><\/p>\n<p> command&#8217;s<\/p>\n<p><code>-jar<\/code><\/p>\n<p> option. For example, say you have a runnable jar file called<\/p>\n<p><code>myjar.jar<\/code><\/p>\n<p>. Because the file is runnable, you can execute it like this:<\/p>\n<p><a href=\"https:\/\/www.javaworld.com\/article\/2077492\/core-java\/java-tip-127--see-jar-run.html#jump\">To read this article in full, please click here<\/a><\/p>\n<\/section>\n<\/article>\n<p> <a href=\"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/2002\/05\/10\/java-tip-127-see-jar-run\/\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":198,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"slim_seo":[],"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[2,6,7],"tags":[398,402,397,414,413,410,409,407,408,406,399,400,394,375,558,556,557,560,559,555,561,566,553,554,565,563,564,562,183,567,568,10,401,396,403,412,411,395,405,404],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7prtj-ekN","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/55105"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/users\/198"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/comments?post=55105"}],"version-history":[{"count":1,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/55105\/revisions"}],"predecessor-version":[{"id":55106,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/55105\/revisions\/55106"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/media?parent=55105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/categories?post=55105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/tags?post=55105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}