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

JAVA_HOME is not being passed to ant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ant-plugin
    • None
    • Ubuntu 12.10

      I have an build job which uses Java 1.6. Both java 1.6 and 1.7 are available on the system and I set JAVA_HOME to pickup 1.6.

      Even when I set JAVA_HOME system wide in /etc/environment, ant is being called without that variable and my build is failing.

      I tried the following to find it:

      Renamed the existing ant as ant.bak in /usr/bin, create an file called ant which prints the environment variables and calls the actual ant. The output of the above does not contain the variable JAVA_HOME.

      My system properties shows

      java.home /usr/lib/jvm/java-7-openjdk-amd64/jre
      JAVA_HOME /usr/lib/jvm/java-6-openjdk-amd64

      but it is not taken into consideration. I export JAVA_HOME outside of jenkins and do an ant, the build is success.

      I have not installed the envinject plugin.

      Regards,
      Seenu.

            Unassigned Unassigned
            seenutn Srinivasa T N
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: