{"id":8467,"date":"2021-09-19T09:20:40","date_gmt":"2021-09-19T01:20:40","guid":{"rendered":"http:\/\/www.hefeiyu.com\/?p=8467"},"modified":"2021-09-30T09:40:32","modified_gmt":"2021-09-30T01:40:32","slug":"day14-import%e4%b9%8b-2-%e5%b8%a6%e5%85%a5java%e6%88%96%e5%85%b6%e4%bb%96fgl%e5%a5%97%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.hefeiyu.com\/?p=8467","title":{"rendered":"[day14]  IMPORT\u4e4b 2: \u5e26\u5165JAVA\u6216\u5176\u4ed6FGL\u5957\u4ef6"},"content":{"rendered":"<h2>\u6587\u7ae0\u6765\u81ea\uff1a<a href=\"https:\/\/ithelp.ithome.com.tw\/users\/20051169\">iT \u90a6\u5e6b\u5fd9::\u4e00\u8d77\u5e6b\u5fd9\u89e3\u6c7a\u96e3\u984c\uff0c\u62ef\u6551 IT \u4eba\u7684\u4e00\u5929 (ithome.com.tw)<\/a><\/h2>\n<h2>[day14] IMPORT\u4e4b 2: \u5e26\u5165JAVA\u6216\u5176\u4ed6FGL\u5957\u4ef6<\/h2>\n<p>\u524d\u4e00\u7bc7IMPORT\u4e2d\uff0c\u63d0\u5230Genero Package\u4e2d\u6709\u63d0\u4f9b\u4e00\u4e9b\u9884\u5148\u5236\u4f5c\u7684\u529f\u80fd\u5957\u4ef6\u53ef\u7528\u3002<\/p>\n<p>\u53ef\u662f\u9762\u5bf9\u5c42\u51fa\u4e0d\u7a77\u7684\u65b0\u529f\u80fd\uff0cGenero\u52bf\u5fc5\u4e0d\u53ef\u80fd\u9762\u9762\u4ff1\u5230\u3002\u4e00\u6765\u5f97\u9760\u5176\u4ed6\u7684 Genero\u7528\u6237\u652f\u6301\u3002\u6216\u662f\u9760\u5176\u4ed6\u8bed\u8a00\u7684\u7279\u6027\u3002\u56e0\u6b64IMPORT \u6307\u4ee4\u989d\u5916\u8fd8\u53ef\u652f\u6301\uff1a<\/p>\n<ol>\n<li>\u76f4\u63a5\u6c47\u5165\u73b0\u5b58\u7684 42m \u6863\u6848\uff0c\u6269\u589e\u7528\u9014<\/li>\n<li>\u76f4\u63a5\u6c47\u5165\u73b0\u5b58\u7684 JAVA-JAR \u6863\u6848\uff0c\u6269\u589e\u7528\u9014<\/li>\n<\/ol>\n<h3>IMPORT JAVA<\/h3>\n<p>\u4e0d\u53ef\u5426\u8ba4\u7684\uff0c\u867d\u7136JAVA\u5f00\u53d1\u662f\u8f83\u4e3a\u590d\u6742\u7684\uff0c\u4f46\u662f\u8fd0\u7528JAVA\u7fa4\u4f53\u4ecd\u65e7\u5e7f\u5927\u3002\u8bb8\u591a lib \u6216\u529f\u80fd\u5305\u4e5f\u90fd\u6709\u63d0\u4f9b JAR \u6863\u4e0b\u8f7d\u8fd0\u7528\u3002\u56e0\u6b64 FGL \u5f00\u653e\u76f4\u63a5\u8c03\u7528 JAR \u4e2d\u7684\u53d8\u91cf\u3001function \u8ba9 FGL \u53ef\u8c03\u7528\u4e5f\u662f\u5f88\u6b63\u5e38\u7684\u4e8b\u3002<\/p>\n<h4>\u5c0f\u7a0b\u5e8f\u76f4\u63a5\u5f00\u53d1<\/h4>\n<p>Hello World\u518d\u73b0\uff0c\u64b0\u5199\u4e00\u4e2a\u5c0f\u578b\u7684 java \u7a0b\u5e8f\uff0c\u547d\u540d\u4e3a Helloworld.java<\/p>\n<p>public class Helloworld {<\/p>\n<p>public String init(){<\/p>\n<p>return &#8220;hello&#8221;;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\u63d0\u4f9b\u4e00\u4e2afunction init\uff0c\u88ab\u547c\u53eb\u7684\u65f6\u5019\u56de\u4f20\u4e00\u4e2a\u5b57\u7b26\u4e32 &#8220;hello&#8221;<\/p>\n<p>\u4f7f\u7528\u7684\u73af\u5883\u5229\u7528 java -version \u53ef\u5f97\u77e5\u4e3a openjdk version &#8220;1.8.0_232&#8221;<br \/>\n(\u5efa\u8bae\u57281.8\u4ee5\u4e0a\u5373\u53ef\uff0c1.6\u7248\u672c\u8fc7\u4f4e\uff0c\u5efa\u8bae\u66f4\u65b0)<\/p>\n<p>\u5b58\u76d8\u540e\u4f7f\u7528 ** javac Helloworld.java ** \u7f16\u8bd1\u51fa Helloworld.class\u6863\u6848<br \/>\n\u4f7f\u7528\u00a0<strong>jar -cvfm Helloworld.jar MANIFEST.MF Helloworld.class<\/strong>\u00a0\u7f16\u8bd1\u51fa jar \u6a94<br \/>\n\u6700\u540e\u4f7f\u7528 **export CLASSPATH=$PWD\/Helloworld.jar:$CLASSPATH **\u6307\u4ee4\uff0c\u5c06\u6b64 jar \u6863\u6848\u52a0\u5165 CLASSPATH \u641c\u5bfb\u8def\u5f84\u4e2d\uff0c\u4ee5\u4fbf\u7f16\u8bd1\u7a0b\u5e8f\u641c\u5bfb\u5e76\u5b8c\u6210\u8fde\u7ed3<\/p>\n<h4>\u4f7f\u7528package<\/h4>\n<p>\u5982\u679c\u8981\u4e32\u63a5\u7684 function \u6bd4\u8f83\u591a\uff0c\u5e94\u8be5\u8981\u7528\u6709\u7ed3\u6784\u5316\u7684\u65b9\u5f0f\u8fdb\u884c\u6709\u89c4\u5219\u7684 source\u8c03\u6574\u4e0e\u5b58\u653e<\/p>\n<ul>\n<li>STEP1 java package\u7684\u76ee\u5f55\u9636\u5c42<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"82\" class=\"wp-image-8468\" src=\"http:\/\/www.hefeiyu.com\/wp-content\/uploads\/2021\/09\/unnamed-file-324.png\" alt=\"\u6587\u672c \u63cf\u8ff0\u5df2\u81ea\u52a8\u751f\u6210\" \/><\/li>\n<li>STEP2 \u5728\u8def\u5f84\u4e0a\u5f00\u53d1Hellopkg.java<\/li>\n<\/ul>\n<p>package com.dsc.svms.hello;<\/p>\n<p>public class Hellopkg {<\/p>\n<p>public String init(){<\/p>\n<p>return &#8220;hi in pkg&#8221;;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\u4ece\u4e0a\u65b9\u7684Hellopkg.java \u8303\u4f8b\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u521d\u59cb\u65f6\u5c31\u8981\u5ba3\u544a\u73b0\u5728\u5b58\u5728\u54ea\u4e2a\u8def\u5f84\uff0c\u8bb0\u5f97\u6b64\u5904\u4e0e\u5916\u90e8\u7684\u8def\u5f84\u8981\u80fd\u591f\u52fe\u7a3d\u3002<\/p>\n<ul>\n<li>STEP3 \u5b58\u76d8\u540e\u4f7f\u7528 ** javac Hellopkg.java ** \u7f16\u8bd1\u51fa Hellopkg.class\u6863\u6848<\/li>\n<li>STEP4\u00a0<strong>\u56de\u5230 com \u76ee\u5f55\u4e4b\u5916<\/strong>\uff0c\u51c6\u5907\u6253\u5305 jar\uff0c\u8981\u628a\u5b8c\u6574\u8def\u5f84\u6253\u5305\u8fdb\u53bb<br \/>\n\u4f7f\u7528\u00a0<strong>jar -cvfm Hellopkg.jar MANIFEST.MF com\/<\/strong>\u00a0\u7f16\u8bd1\u51fa jar \u6a94<\/li>\n<li>STEP5 \u6700\u540e\u4f7f\u7528 **export CLASSPATH=$PWD\/Hellopkg.jar:$CLASSPATH **\u6307\u4ee4\uff0c\u5c06\u6b64 jar \u6863\u6848\u52a0\u5165 CLASSPATH \u641c\u5bfb\u8def\u5f84\u4e2d\uff0c\u4ee5\u4fbf\u7f16\u8bd1\u7a0b\u5e8f\u641c\u5bfb\u5e76\u5b8c\u6210\u8fde\u7ed3<\/li>\n<\/ul>\n<h4>\u8c03\u7528\u8303\u4f8b<\/h4>\n<p>\u4e0a\u9762\u7684\u7a0b\u5e8f\u6df7\u548c\u5728\u540c\u4e00\u652f 4GL \u8fdb\u884c\u547c\u53eb\uff0c\u8ba9\u5927\u5bb6\u80fd\u6e05\u695a\u5dee\u5f02\uff1a<\/p>\n<p>IMPORT JAVA Helloworld #\u4f7f\u7528\u5355\u4e00\u7a0b\u5e8f\u8def\u5f84<\/p>\n<p>IMPORT JAVA com.dsc.svms.hello.Hellopkg #\u4f7f\u7528Package\u8def\u5f84<\/p>\n<p>MAIN<\/p>\n<p>DEFINE str string<\/p>\n<p>DEFINE abc Helloworld #\u5f15\u5165\u540e\u8981\u4f7f\u7528\uff0c\u4e00\u5b9a\u8981\u7528\u5bf9\u8c61\u7684\u65b9\u5f0f\u5ba3\u544a<\/p>\n<p>DEFINE def Hellopkg #\u8fd9\u91cc\u662f\u5957\u4ef6\u7248\u7684<\/p>\n<p>LET abc = Helloworld.create() #\u6ce8\u610f\uff1ajava\u6ca1\u6709\uff0c\u4f46\u4ecd\u8981\u8fd9\u6837\u53eb\uff0cFGL\u8981\u6c42\u7684<\/p>\n<p>LET str = &#8220;CALL Direct:&#8221;,abc.init() #\u8fd9\u91cc\u624d\u662f java\u6709\u7684<\/p>\n<p>DISPLAY str<\/p>\n<p>LET def = Hellopkg.create() #PKG\u53ea\u662f IMPORT\u8def\u5f84\u4e0d\u540c\uff0c\u7528\u6cd5\u90fd\u76f8\u540c<\/p>\n<p>LET str = &#8220;CALL Package:&#8221;,def.init()<\/p>\n<p>DISPLAY str<\/p>\n<p>END MAIN<\/p>\n<p>\u6267\u884c\u540e<br \/>\n<img loading=\"lazy\" decoding=\"async\" width=\"567\" height=\"96\" class=\"wp-image-8469\" src=\"http:\/\/www.hefeiyu.com\/wp-content\/uploads\/2021\/09\/unnamed-file-325.png\" alt=\"\u6587\u672c \u63cf\u8ff0\u5df2\u81ea\u52a8\u751f\u6210\" \/><\/p>\n<h3>IMPORT FGL<\/h3>\n<p>\u5bf9\u4e8e FGL\u7684IMPORT\uff0c\u57fa\u672c\u4e0a\u662f\u63d0\u4f9b\u4e00\u4e2a\u5bf9\u8c61\u5316\u7684\u547c\u53eb\u65b9\u5f0f\u3002\u4e14 IMPORT FGL\u65f6\uff0c\u88ab\u5f15\u5165\u768442m\u6863\u6848\u5fc5\u987b\u4e8b\u5148\u5b58\u5728(\u6ce8)\uff0c\u56e0\u6b64\u5f53\u4f7f\u7528\u7684 IMPORT \u5c42\u7ea7\u8f83\u590d\u6742\u7684\u65f6\u5019\uff0c\u7f16\u8bd1\u7cfb\u7edf\u8981\u80fd\u591f\u8ddf\u4e0a\u3002<\/p>\n<p>\u8bed\u6cd5\u8303\u4f8b IMPORT FGL lib_cl_dlg<\/p>\n<p>\u4e0d\u5e26\u9644\u6863\u540d<\/p>\n<p>\u6ce8\uff1aGenero 2.50\u5957\u4ef6\u8d77\uff0c\u5f00\u653e\u4f7f\u7528IMPORT FGL\u3002\u7f16\u8bd1\u524d\u5fc5\u987b\u81ea\u884c\u786e\u8ba4\u9700\u4f7f\u7528\u7684 42m\u6863\u6848\u662f\u5426\u5df2\u5b58\u5728\u4e8e\u5f53\u4e0b\u8def\u5f84\uff0c\u6216FGLLDPATH \u73af\u5883\u53d8\u91cf\u4e2d (&#8211;JAVA\u662f CLASSPATH&#8211;)\u3002<br \/>\nGenero 4.00\u5957\u4ef6\u540e\uff0c\u5f00\u653e\u53ef\u8ba9 FGL \u76f8\u4e92 IMPORT\uff0c\u7f16\u8bd1\u65f6 fglcomp \u53ef\u4e3b\u52a8\u5e2e\u5fd9\u5c06 IMPORT FGL\u4f46\u4e0d\u5b58\u5728\u7684\u90e8\u5206\u8fdb\u884c\u7f16\u8bd1\uff0c\u5e76\u81ea\u52a8\u907f\u514d\u76f8\u4e92 IMPORT \u9020\u6210\u7684\u903b\u8f91\u6027\u62a5\u9519 (\u4e0d\u518d\u62a5\u9519)<\/p>\n<p>\u56e0\u6b64\uff0c\u5f53\u9700\u8981\u4f7f\u7528 IMPORT FGL\u65f6\uff0c\u9664\u4e86\u547c\u53eb\u65b9\u5f0f\u53ef\u7528\u7c7b\u4f3c\u5bf9\u8c61\u7684\u547c\u53eb\u65b9\u6cd5\uff0c\u5176\u4f59\u4e0e link \u529f\u80fd\u5747\u76f8\u540c\u3002<\/p>\n<h4>FGL\u652f\u6301IMPORT \u5bf9\u8c61\u4e0e\u8303\u4f8b####<\/h4>\n<p>\u8303\u4f8b<\/p>\n<p>\u8c03\u7528\u7aef<\/p>\n<p>IMPORT FGL module_01<\/p>\n<p>IMPORT FGL module_02<\/p>\n<p>\u4e00\u822c\u51fd\u5f0f function: CALL module_01.create()<\/p>\n<p>\u5bf9\u8bdd\u6846<\/p>\n<p>DIALOG<\/p>\n<p>SUBDIALOG module_01.subinput<\/p>\n<p>SUBDIALOG module_02.subinput<\/p>\n<p>END DIALOG<\/p>\n<p>\u88ab\u8c03\u7528\u7aef &#8211; module_01\/module_02 \u4e24\u53ea<\/p>\n<p>DIALOG subinput()<\/p>\n<p>IMPORT FGL\u9664\u4e86\u652f\u6301function\u547c\u53eb\u5916\uff0c\u4e5f\u652f\u6301\u5e38\u7528\u7684\u5bf9\u8bdd\u6846\u5bf9\u8c61\u5316\u3002\u82e5\u5927\u591a\u6570\u753b\u9762\u8981\u5f15\u5165\u540c\u4e00\u529f\u80fd\uff0c\u8fc7\u5f80\u90fd\u9700\u8981\u91cd\u590d\u64b0\u5199\u3002\u4ece Genero 2.50 \u5f00\u59cb\u652f\u6301 IMPORT FGL \u540e\uff0c\u6b64\u7c7b\u91cd\u590d\u6027\u7a0b\u5e8f\u4ee3\u7801\u5df2\u53ef\u5927\u5e45\u51cf\u4f4e\uff0c\u5f80 Low Code\u524d\u8fdb\u3002<\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/www.hefeiyu.com\">\u8d6b\u975e\u57df<\/a> &raquo; <a href=\"https:\/\/www.hefeiyu.com\/?p=8467\">[day14]  IMPORT\u4e4b 2: \u5e26\u5165JAVA\u6216\u5176\u4ed6FGL\u5957\u4ef6<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6765\u81ea\uff1aiT \u90a6\u5e6b\u5fd9::\u4e00\u8d77\u5e6b\u5fd9\u89e3\u6c7a\u96e3\u984c\uff0c\u62ef\u6551 IT \u4eba\u7684\u4e00\u5929 (ithome.com.tw) [day14] IMPORT\u4e4b 2: \u5e26\u5165JAVA\u6216\u5176\u4ed6FGL\u5957\u4ef6 \u524d\u4e00\u7bc7IMPORT\u4e2d\uff0c\u63d0\u5230Genero Package\u4e2d\u6709\u63d0\u4f9b\u4e00\u4e9b\u9884\u5148\u5236\u4f5c\u7684\u529f\u80fd\u5957\u4ef6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[490,26],"tags":[171,76,77],"class_list":["post-8467","post","type-post","status-publish","format-standard","hentry","category-490","category-4gl","tag-fgl","tag-import","tag-java"],"_links":{"self":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/8467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8467"}],"version-history":[{"count":3,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/8467\/revisions"}],"predecessor-version":[{"id":8532,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/8467\/revisions\/8532"}],"wp:attachment":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}