{"id":2245,"date":"2021-08-18T13:36:53","date_gmt":"2021-08-18T13:36:53","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr\/java-libraries\/what-is-a-java-dependancy\/"},"modified":"2021-08-18T13:52:34","modified_gmt":"2021-08-18T13:52:34","slug":"what-is-a-java-dependancy","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr\/java-libraries\/what-is-a-java-dependancy","title":{"rendered":"What is a Java dependency?"},"content":{"rendered":"\n<p>It is possible to extend the Mendix platform with <a href=\"https:\/\/docs.mendix.com\/refguide\/java-programming\" target=\"_blank\" rel=\"noreferrer noopener\">custom Java code<\/a>. This is particularly helpful if the desired functionality cannot be achieved with Mendix functionality (it is best practice to exhaust platform capabilities before switching to custom code).<\/p>\n\n\n\n<p>When creating custom <a href=\"https:\/\/docs.mendix.com\/refguide\/java-actions\" target=\"_blank\" rel=\"noreferrer noopener\">Java actions<\/a> in Mendix, you might want to leverage public libraries that contain specific methods and classes. These libraries are added to the Mendix project in the user library folder.<\/p>\n\n\n\n<p>The custom Java actions you create are stored as a <em>java <\/em>file on the module level.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Each Java action defined in Studio Pro corresponds to a file&nbsp;<em>{name of Java action}.java<\/em>&nbsp;in the subdirectory&nbsp;<em>javasource\/{module name}\/actions<\/em>&nbsp;of the app directory.<\/p><\/blockquote>\n\n\n\n<p>In software development, it is common practice to reuse software libraries to speed up development. This same practice inspired the reusable components of the Mendix platform. In Java, this is no different. To speed up development (and stop everybody from reinventing the wheel), you leverage Java libraries with predefined classes and methods. These libraries are commonly stored in what we call a <strong>jar<\/strong> file, which stands for <strong>J<\/strong>ava\u00a0<strong>AR<\/strong>chive.<\/p>\n\n\n\n<p>Within Mendix, all jar files are stored in the <em>userlib<\/em> in the Mendix project folder. The <em>userlib<\/em> got its name from \u201cwhere users (read users of Mendix Studio Pro) add their Java libraries.\u201d<\/p>\n\n\n\n<p>The <em>dependency<\/em> refers to the relation between the Java action and the jar. The Java action uses specific classes or methods from the jar and is therefore dependent on the jar. If it isn\u2019t there, it doesn\u2019t work.<\/p>\n","protected":false},"featured_media":0,"parent":2201,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-2245","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2245"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2245"}],"version-history":[{"count":4,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2245\/revisions"}],"predecessor-version":[{"id":2266,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2245\/revisions\/2266"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2201"}],"next":[{"title":"Why do you need a jar?","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr\/java-libraries\/why-do-you-need-a-jar","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2248"}],"prev":[{"title":"Introduction","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr\/java-libraries\/introduction","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/2203"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2245"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=2245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}