Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36752

not able to launch ant in jenkins

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: ant-plugin
    • Labels:
      None
    • Environment:
      master on-CENTOS 7
      slave on-RHEL 6
    • Similar Issues:

      Description

      while compiling ant dist its not able to launch the ant and its giving error.

      error:
      $ ant dist
      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
      Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      Could not find the main class: org.apache.tools.ant.launch.Launcher. Program will exit.
      Build step 'Invoke Ant' marked build as failure

      please check the issue and reply as soon as possible.
      and i tried setting both JAVA_HOME and ANT_HOME still giving the same error.

        Attachments

        1. ant_config.PNG
          ant_config.PNG
          20 kB
        2. auto_ant.PNG
          auto_ant.PNG
          16 kB
        3. screenshot-1.png
          screenshot-1.png
          20 kB
        4. Screen Shot 2016-07-18 at 15.03.15.png
          Screen Shot 2016-07-18 at 15.03.15.png
          94 kB

          Activity

          Hide
          armfergom Armando Fernandez added a comment -

          Hi Niranjan Chougula, what version of Java are you using?

          This does not seem like an issue with the Ant Plugin though, but an issue with your current installation since you cannot even run Ant from the command line, can you?

          Show
          armfergom Armando Fernandez added a comment - Hi Niranjan Chougula , what version of Java are you using? This does not seem like an issue with the Ant Plugin though, but an issue with your current installation since you cannot even run Ant from the command line, can you?
          Hide
          build Niranjan Chougula added a comment -

          from command line it is running fine only and but when i try with jenkins its giving the error ....

          and its not a problen with Ant-Pluggin

          Show
          build Niranjan Chougula added a comment - from command line it is running fine only and but when i try with jenkins its giving the error .... and its not a problen with Ant-Pluggin
          Hide
          build Niranjan Chougula added a comment - - edited

          java -version
          java version "1.6.0_18"
          Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
          Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)

          ant -version
          Apache Ant version 1.7.1 compiled

          Show
          build Niranjan Chougula added a comment - - edited java -version java version "1.6.0_18" Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode) ant -version Apache Ant version 1.7.1 compiled
          Hide
          armfergom Armando Fernandez added a comment -

          Have you configured the Ant Tool installation in jenkins_url/configure page?

          Show
          armfergom Armando Fernandez added a comment - Have you configured the Ant Tool installation in jenkins_url/configure page?
          Hide
          build Niranjan Chougula added a comment - - edited

          its done

          but for this node im trying to run it on the jenkins slave so is there a way to set ant on slave???

          Show
          build Niranjan Chougula added a comment - - edited its done but for this node im trying to run it on the jenkins slave so is there a way to set ant on slave???
          Hide
          armfergom Armando Fernandez added a comment -

          If that does not work, could you try to not use an automatically installed Ant, and point it to your working Ant installation home?

          Uncheck "Install automatically" and an ANT_HOME field should appear. Try setting the installation there if you have not tried it already.

          Show
          armfergom Armando Fernandez added a comment - If that does not work, could you try to not use an automatically installed Ant, and point it to your working Ant installation home? Uncheck "Install automatically" and an ANT_HOME field should appear. Try setting the installation there if you have not tried it already.
          Hide
          build Niranjan Chougula added a comment - - edited

          actually its working well for few other projects in the master for this one only giving that problem...

          im running this project in the slave ....so tell me if any confiruration are required there???

          Show
          build Niranjan Chougula added a comment - - edited actually its working well for few other projects in the master for this one only giving that problem... im running this project in the slave ....so tell me if any confiruration are required there???
          Hide
          build Niranjan Chougula added a comment -

          im waiting for your solution!!!!!!!!!!

          Show
          build Niranjan Chougula added a comment - im waiting for your solution!!!!!!!!!!
          Hide
          armfergom Armando Fernandez added a comment -

          You can set the location of Ant Installation in your slave in the slave's configuration page. If you scroll all the way down and check "Tool Locations" you will see the option to add an Ant installation location for your slave.

          Show
          armfergom Armando Fernandez added a comment - You can set the location of Ant Installation in your slave in the slave's configuration page. If you scroll all the way down and check "Tool Locations" you will see the option to add an Ant installation location for your slave.
          Hide
          build Niranjan Chougula added a comment - - edited


          still same error

          Show
          build Niranjan Chougula added a comment - - edited still same error
          Hide
          jglick Jesse Glick added a comment -

          Use build.sh from Ant sources.

          Show
          jglick Jesse Glick added a comment - Use build.sh from Ant sources.

            People

            Assignee:
            build Niranjan Chougula
            Reporter:
            build Niranjan Chougula
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: