Topic
4 replies Latest Post - ‏2013-07-17T22:47:19Z by Ben Cox
OFWHMG
OFWHMG
27 Posts
ACCEPTED ANSWER

Pinned topic z/OS Explorer V2.1 ANT support

‏2013-07-16T18:27:22Z |

I could not find a forum for the new z/OS Explorer so I will post my question here.

I am trying to use Apache ANT in z/OS Explorer V2.1 and am receiving the attached errors.  I downloaded the two .jar files I needed for ANT and added them via Window>Preferences>Ant>Runtime>Ant Home Entries>Add ExternalJARS button.  I added jakarta-oro-2.0.8,jar and commoons-net-3.3.jar.

My question is : Does z/OS Explorer v2.1 support/work with ANT.

 

  • Ben Cox
    Ben Cox
    4 Posts
    ACCEPTED ANSWER

    Re: z/OS Explorer V2.1 ANT support

    ‏2013-07-16T22:58:52Z  in response to OFWHMG

    Hi William,

    Ant is supported in the IBM Explorer for z/OS V2.1, and should work out-of-the-box. If you're experiencing problems, I suggest you create a very simple build file to check that you can run the simplest scenario. For example, I've created a new project, then added a new file called build.xml, and then used the 'Simple buildfile with two targets' Ctrl+Space template to create a very simple test and put some echos in. I then ran it using right-click -> Run As -> Ant Build. The script ran to completion.

    It's also possible to run much more complex scenarios, including importing additional JARs as you've mentioned, but I suggest running the simple test first to narrow down the problem.

    Thanks,

    Ben

  • OFWHMG
    OFWHMG
    27 Posts
    ACCEPTED ANSWER

    Re: z/OS Explorer V2.1 ANT support

    ‏2013-07-17T13:13:18Z  in response to OFWHMG

    Ben, when you said that Ant "should work out-of-the-box" with zOS Explorer, I took that to mean that I didn't have to add those two .jar files.  I deleted them.  I got the idea I needed them from RedBook SG24-7177 Java Stand-alone Applications on z/OS Volume 1.

    I typed up your simple example and ran it but it still failed with the same error.  I looked at every option when "Run as Ant Build" was chosen and I found that changing the JRE to the workspace JRE (Java 7) fixed the problem.  I have attached two screenshots of what I changed. 

    Thanks for you help. 

     

     

  • OFWHMG
    OFWHMG
    27 Posts
    ACCEPTED ANSWER

    Re: z/OS Explorer V2.1 ANT support

    ‏2013-07-17T15:04:49Z  in response to OFWHMG

    I take that comment back about not needing those External Jar files for Ant.  When I actually tried to ftp a file to z/OS USS directories I received - NoClassDefFoundError: org.apache.commons.net.ftp.FTPClientConfig.  After adding those two .jar files back,it worked.

  • Ben Cox
    Ben Cox
    4 Posts
    ACCEPTED ANSWER

    Re: z/OS Explorer V2.1 ANT support

    ‏2013-07-17T22:47:19Z  in response to OFWHMG

    It's good to know that you got it working. As you discovered, if you need to do something that those JARs specifically provide, such as FTP support, you'll need them added to the Ant classpath.

    The only thing to be wary of when choosing "Run in the same JRE as the workspace" is that it really does mean the exact same JRE instance - so for example, if your Ant script happened to do something bad and consume all the memory in the JVM until it got an OutOfMemoryError, that may adversely affect the stability of your z/OS Explorer. It might never be a problem you encounter, but I thought I'd better warn you.

    It's possible that there's a problem with the particular JRE ('jdk' in your environment) that it was previously pointing at. My Ant script runs, by default, using the JRE that came supplied with z/OS Explorer - and that worked fine. Perhaps try pointing it at just a a JRE instead of a full JDK.