<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add jars to a executable JAR file_OTK Java in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/652684#M9343</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can add information about dependencies in the registry file called creotk.dat or protk.dat to field &lt;STRONG&gt;java_app_classpath&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more info search &lt;STRONG&gt;CLASSPATH Variables&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;Registry File&lt;/STRONG&gt; in documentation.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 09:30:24 GMT</pubDate>
    <dc:creator>YaroslavSin</dc:creator>
    <dc:date>2020-03-05T09:30:24Z</dc:date>
    <item>
      <title>Add jars to a executable JAR file_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/650463#M9299</link>
      <description>&lt;P&gt;Hello everyone!&lt;BR /&gt;&lt;BR /&gt;Please tell me how to add dependencies (other jar files) to the project jar file.&lt;BR /&gt;For example, I want to use logging during development, but I can not start the application, since Creo throws an error that the class will not find.&lt;BR /&gt;I used the gradle build tool.&lt;/P&gt;
&lt;P&gt;I pointed out the classpath in MANIFEST, added jar files inside my jar, but it still doesn't work.&lt;/P&gt;
&lt;P&gt;My gradle code:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;jar {
    //from {
    //	configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    //}
    manifest {
        attributes(
                "Implementation-Title": "Jar Making Example",
                'Implementation-Version': "1.0",
                "Main-Class": "ru.Test",
                "Class-Path": configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
        )
    }
    destinationDirectory = file("build\\tmp\\jar")
    archivesBaseName = 'app'
    //C:\Program Files\PTC\Creo 5.0.2.0\Common Files\text\java\otk.jar
}&lt;/LI-CODE&gt;
&lt;P&gt;My jar:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VladiSlav_0-1582382860389.png" style="width: 577px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23839i1F0CAAC66A3C4B65/image-dimensions/577x111?v=v2" width="577" height="111" role="button" title="VladiSlav_0-1582382860389.png" alt="VladiSlav_0-1582382860389.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My MANIFEST:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VladiSlav_1-1582382905193.png" style="width: 463px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23840i9E0191448933F946/image-dimensions/463x73?v=v2" width="463" height="73" role="button" title="VladiSlav_1-1582382905193.png" alt="VladiSlav_1-1582382905193.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;public class Test {
   
    private static final Logger log = LogManager.getLogger(Test.class);
    public static void start() throws jxthrowable {
        Session session = pfcSession.GetCurrentSessionWithCompatibility(CreoCompatibility.C4Compatible);
        session.UIShowMessageDialog("Hello", null);
        log.error("Hello!");
    }
    
    public static void stop() throws jxthrowable {
        
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;This code works without the log4j2 classes in Creo.&lt;BR /&gt;Logging also works in the IDE if the &lt;STRONG&gt;start&lt;/STRONG&gt; &lt;STRONG&gt;()&lt;/STRONG&gt; method is started from the &lt;STRONG&gt;main ()&lt;/STRONG&gt; method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;BR /&gt;Best Regards!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 14:59:37 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/650463#M9299</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2020-02-22T14:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add jars to a executable JAR file_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/652684#M9343</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you can add information about dependencies in the registry file called creotk.dat or protk.dat to field &lt;STRONG&gt;java_app_classpath&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more info search &lt;STRONG&gt;CLASSPATH Variables&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;Registry File&lt;/STRONG&gt; in documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 09:30:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/652684#M9343</guid>
      <dc:creator>YaroslavSin</dc:creator>
      <dc:date>2020-03-05T09:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add jars to a executable JAR file_OTK Java</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/653420#M9357</link>
      <description>&lt;P&gt;Thanks for the answer!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 05:46:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Add-jars-to-a-executable-JAR-file-OTK-Java/m-p/653420#M9357</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2020-03-10T05:46:52Z</dc:date>
    </item>
  </channel>
</rss>

