AW: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-14 Thread Herrn, Marco
Hello Björn,

no, the jdk installation is file. It does contain the jre subdirectory 
(`$JAVA_HOME/jre`).
The problem seems to be that Jenkins sets the `${java.home} system property to 
that jre subdirectory (`$JAVA_HOME/jre `) instead of the correct one 
(`$JAVA_HOME).
Then the maven-javadoc-plugin tries to find the `javadoc` executable under 
`${java.home}/bin` which fails, since `${java.home}` points to the wrong 
location.

See the error message:
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on 
project XXX: MavenReportException: Error while generating Javadoc: Unable to 
find Javadoc command: The Javadoc executable 
‘/opt/oracle_jdk1.8.0_191/jre/bin/javadoc’ doesn’t exist or is not a file. 
Verify the  parameter.
BR
Marco



Von: 'Björn Pedersen' via Jenkins Users 
Gesendet: Donnerstag, 14. November 2019 09:12
An: Jenkins Users 
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

Hi,

Maybe this be a stripped down/incomplete jdk install. If looking into one of my 
jdk installs(manual install with oracle installer), there is a jre subdirectory 
 present.

Björn
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ca918127-f740-4463-b130-55686f6205e3%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB3107FA407C0B2B8E5D14D40EE0710%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM.


Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-14 Thread 'Björn Pedersen' via Jenkins Users
Hi,

Maybe this be a stripped down/incomplete jdk install. If looking into one 
of my jdk installs(manual install with oracle installer), there is a jre 
subdirectory  present. 

Björn

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ca918127-f740-4463-b130-55686f6205e3%40googlegroups.com.


AW: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-13 Thread Herrn, Marco
That’s unfortunate.
But many thanks for your help.

BR
Marco

Von: jenkinsci-users@googlegroups.com  Im 
Auftrag von Mark Waite
Gesendet: Mittwoch, 13. November 2019 15:40
An: Jenkins Users 
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?



On Wed, Nov 13, 2019 at 6:30 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello Mark,

yes, it is running on the master. We only have a master to don’t run any agents.

You write:
Fix the environment in the script that launches the Jenkins master so that it 
uses the JDK you want instead of the JRE it is actually using now.  That may 
require that you change the value of PATH.  It may require that you define 
JAVA_HOME.  In either case, Jenkins in your environment needs to run with a 
JDK, not a JRE.  It is currently running with a JRE.

As the system information displays a totally different `java.home` than the 
failing maven report, It don’t think that settings are related.

Anyway I tried setting and exporting the $JAVA_HOME directly in the Jenkins 
start script and in the global environment variables in Jenkins settings. 
`java.home` does change then, but still appends “jre”. But the actual 
$JAVA_HOME environment variable is also set and points to “/opt/jdk8” as I have 
set it.

However the problem persists. It is obviously respecting my JAVA_HOME, since it 
is using it for the maven build, but it insists on appending /jre.

How can I get rid of that?


I don't know.  None of the environments that I maintain have that problem.  I 
installed on Debian 9 using the Debian installer, on Windows 10 using 
jenkins.war, and in a Docker image.  I don't have any other suggestions to 
offer.

That problem didn’t exist with Jenkins 1 as this build worked correctly in it.

BR
Marco

Von: jenkinsci-users@googlegroups.com 
mailto:jenkinsci-users@googlegroups.com>> Im 
Auftrag von Mark Waite
Gesendet: Mittwoch, 13. November 2019 01:32
An: Jenkins Users 
mailto:jenkinsci-users@googlegroups.com>>
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?



On Tue, Nov 12, 2019 at 12:59 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello Mark,

in the Jenkins System Information page I see the

“java.home” set to 
“/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre”


I believe that report of the value of java.home is reporting the JRE you are 
using to run the Jenkins master.  Whatever technique is being used to run 
Jenkins is choosing 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java as 
the Java which should run Jenkins.

Based on your report that maven is failing with a message about the wrong java, 
I assume that the maven job which is failing is using an executor on the 
Jenkins master.  Can you confirm that the failure happened when the job ran on 
an executor on the Jenkins master?

If the failure is happening when the job runs on an executor on the master, 
then you have a few choices.  You could:

  *   Fix the environment in the script that launches the Jenkins master so 
that it uses the JDK you want instead of the JRE it is actually using now.  
That may require that you change the value of PATH.  It may require that you 
define JAVA_HOME.  In either case, Jenkins in your environment needs to run 
with a JDK, not a JRE.  It is currently running with a JRE.
  *   Create a Jenkins agent configured to use the desired JDK and run the 
build on the Jenkins agent
Mark Waite

which is yet another JVM installation.

There is no additional “JAVA_HOME” environment variable.

I am not really sure what you mean by

“If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?”

I have defined my JDKs in the Configuration of Helpers and specified the 
JAVA_HOME for each one:

[cid:image001.jpg@01D59AC6.1D00C710]

There is no such settings for the maven installation and I am not able to 
specify one:

[cid:image002.jpg@01D59AC6.1D00C710]


BR

Marco

Von: jenkinsci-users@googlegroups.com 
mailto:jenkinsci-users@googlegroups.com>> Im 
Auftrag von Mark Waite
Gesendet: Montag, 11. November 2019 17:15
An: Jenkins Users 
mailto:jenkinsci-users@googlegroups.com>>
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

Is there a JAVA_HOME environment variable reported in the Jenkins System 
Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?

If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?

On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello,


I have a Jenkins 2.190.2 running.

I 

Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-13 Thread Mark Waite
On Wed, Nov 13, 2019 at 6:30 AM Herrn, Marco 
wrote:

> Hello Mark,
>
>
>
> yes, it is running on the master. We only have a master to don’t run any
> agents.
>
>
>
> You write:
>
> *Fix the environment in the script that launches the Jenkins master so
> that it uses the JDK you want instead of the JRE it is actually using now.
> That may require that you change the value of PATH.  It may require that
> you define JAVA_HOME.  In either case, Jenkins in your environment needs to
> run with a JDK, not a JRE.  It is currently running with a JRE.*
>
>
>
> As the system information displays a totally different `java.home` than
> the failing maven report, It don’t think that settings are related.
>
>
>
> Anyway I tried setting and exporting the $JAVA_HOME directly in the
> Jenkins start script and in the global environment variables in Jenkins
> settings. `java.home` does change then, but still appends “jre”. But the
> actual $JAVA_HOME environment variable is also set and points to
> “/opt/jdk8” as I have set it.
>
>
> However the problem persists. It is obviously respecting my JAVA_HOME,
> since it is using it for the maven build, but it insists on appending /jre.
>
>
>
> How can I get rid of that?
>
>
>

I don't know.  None of the environments that I maintain have that problem.
I installed on Debian 9 using the Debian installer, on Windows 10 using
jenkins.war, and in a Docker image.  I don't have any other suggestions to
offer.


> That problem didn’t exist with Jenkins 1 as this build worked correctly in
> it.
>
>
>
> BR
>
> Marco
>
>
>
> *Von:* jenkinsci-users@googlegroups.com 
> *Im Auftrag von *Mark Waite
> *Gesendet:* Mittwoch, 13. November 2019 01:32
> *An:* Jenkins Users 
> *Betreff:* Re: How to force jenkins to use $JAVA_HOME/ instead of
> $JAVA_HOME/jre?
>
>
>
>
>
>
>
> On Tue, Nov 12, 2019 at 12:59 AM Herrn, Marco 
> wrote:
>
> Hello Mark,
>
>
>
> in the Jenkins System Information page I see the
>
>
>
> “java.home” set to
> “/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre”
>
>
>
>
>
> I believe that report of the value of java.home is reporting the JRE you
> are using to run the Jenkins master.  Whatever technique is being used to
> run Jenkins is
> choosing 
> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java
> as the Java which should run Jenkins.
>
>
>
> Based on your report that maven is failing with a message about the wrong
> java, I assume that the maven job which is failing is using an executor on
> the Jenkins master.  Can you confirm that the failure happened when the job
> ran on an executor on the Jenkins master?
>
>
>
> If the failure is happening when the job runs on an executor on the
> master, then you have a few choices.  You could:
>
>- Fix the environment in the script that launches the Jenkins master
>so that it uses the JDK you want instead of the JRE it is actually using
>now.  That may require that you change the value of PATH.  It may require
>that you define JAVA_HOME.  In either case, Jenkins in your environment
>needs to run with a JDK, not a JRE.  It is currently running with a JRE.
>- Create a Jenkins agent configured to use the desired JDK and run the
>build on the Jenkins agent
>
> Mark Waite
>
>
>
> which is yet another JVM installation.
>
>
>
> There is no additional “JAVA_HOME” environment variable.
>
>
>
> I am not really sure what you mean by
>
>
>
> “If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a
> JAVA_HOME defined in the context of that JDK tool?
>
>
>
> If you've defined a maven tool, is there a JAVA_HOME defined in the
> context of that maven tool?”
>
>
>
> I have defined my JDKs in the Configuration of Helpers and specified the
> JAVA_HOME for each one:
>
>
>
>
>
> There is no such settings for the maven installation and I am not able to
> specify one:
>
>
>
>
>
>
>
> BR
>
>
> Marco
>
>
>
> *Von:* jenkinsci-users@googlegroups.com 
> *Im Auftrag von *Mark Waite
> *Gesendet:* Montag, 11. November 2019 17:15
> *An:* Jenkins Users 
> *Betreff:* Re: How to force jenkins to use $JAVA_HOME/ instead of
> $JAVA_HOME/jre?
>
>
>
> Is there a JAVA_HOME environment variable reported in the Jenkins System
> Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?
>
>
>
> If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a
> JAVA_HOME defined in the context of that JDK tool?
>
>
>
> If you've defined a maven tool, is there a JAVA_HOME defined in the
> context of that maven tool?
>
>
>
> On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
> wrote:
>
> Hello,
>
>
>
>
>
> I have a Jenkins 2.190.2 running.
>
>
>
> I specified a custom JDK with “JAVA_HOME” set to `/opt/jdk8` which itself
> is a symbolic link to `/opt/oracle_jdk1.8.0_191`.
>
>
>
> Some of my maven builds are now breaking due to the javadoc executable not
> being found:
>
>
>
>
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on
> project 

AW: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-13 Thread Herrn, Marco
Hello Mark,

yes, it is running on the master. We only have a master to don’t run any agents.

You write:
Fix the environment in the script that launches the Jenkins master so that it 
uses the JDK you want instead of the JRE it is actually using now.  That may 
require that you change the value of PATH.  It may require that you define 
JAVA_HOME.  In either case, Jenkins in your environment needs to run with a 
JDK, not a JRE.  It is currently running with a JRE.

As the system information displays a totally different `java.home` than the 
failing maven report, It don’t think that settings are related.

Anyway I tried setting and exporting the $JAVA_HOME directly in the Jenkins 
start script and in the global environment variables in Jenkins settings. 
`java.home` does change then, but still appends “jre”. But the actual 
$JAVA_HOME environment variable is also set and points to “/opt/jdk8” as I have 
set it.

However the problem persists. It is obviously respecting my JAVA_HOME, since it 
is using it for the maven build, but it insists on appending /jre.

How can I get rid of that?

That problem didn’t exist with Jenkins 1 as this build worked correctly in it.

BR
Marco

Von: jenkinsci-users@googlegroups.com  Im 
Auftrag von Mark Waite
Gesendet: Mittwoch, 13. November 2019 01:32
An: Jenkins Users 
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?



On Tue, Nov 12, 2019 at 12:59 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello Mark,

in the Jenkins System Information page I see the

“java.home” set to 
“/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre”


I believe that report of the value of java.home is reporting the JRE you are 
using to run the Jenkins master.  Whatever technique is being used to run 
Jenkins is choosing 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java as 
the Java which should run Jenkins.

Based on your report that maven is failing with a message about the wrong java, 
I assume that the maven job which is failing is using an executor on the 
Jenkins master.  Can you confirm that the failure happened when the job ran on 
an executor on the Jenkins master?

If the failure is happening when the job runs on an executor on the master, 
then you have a few choices.  You could:

  *   Fix the environment in the script that launches the Jenkins master so 
that it uses the JDK you want instead of the JRE it is actually using now.  
That may require that you change the value of PATH.  It may require that you 
define JAVA_HOME.  In either case, Jenkins in your environment needs to run 
with a JDK, not a JRE.  It is currently running with a JRE.
  *   Create a Jenkins agent configured to use the desired JDK and run the 
build on the Jenkins agent
Mark Waite

which is yet another JVM installation.

There is no additional “JAVA_HOME” environment variable.

I am not really sure what you mean by

“If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?”

I have defined my JDKs in the Configuration of Helpers and specified the 
JAVA_HOME for each one:

[cid:image002.jpg@01D59A2C.7D8E6460]

There is no such settings for the maven installation and I am not able to 
specify one:

[cid:image004.jpg@01D59A2C.7D8E6460]


BR

Marco

Von: jenkinsci-users@googlegroups.com 
mailto:jenkinsci-users@googlegroups.com>> Im 
Auftrag von Mark Waite
Gesendet: Montag, 11. November 2019 17:15
An: Jenkins Users 
mailto:jenkinsci-users@googlegroups.com>>
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

Is there a JAVA_HOME environment variable reported in the Jenkins System 
Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?

If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?

On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello,


I have a Jenkins 2.190.2 running.

I specified a custom JDK with “JAVA_HOME” set to `/opt/jdk8` which itself is a 
symbolic link to `/opt/oracle_jdk1.8.0_191`.

Some of my maven builds are now breaking due to the javadoc executable not 
being found:


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on 
project XXX: MavenReportException: Error while generating Javadoc: Unable to 
find Javadoc command: The Javadoc executable 
‘/opt/oracle_jdk1.8.0_191/jre/bin/javadoc’ doesn’t exist or is not a file. 
Verify the  parameter.


Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
Why is Jenkins referring to the jre subdirectory? When calling maven with the 
-X parameter I see that jenkins 

Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-12 Thread Mark Waite
On Tue, Nov 12, 2019 at 12:59 AM Herrn, Marco 
wrote:

> Hello Mark,
>
>
>
> in the Jenkins System Information page I see the
>
>
>
> “java.home” set to
> “/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre”
>
>
>

I believe that report of the value of java.home is reporting the JRE you
are using to run the Jenkins master.  Whatever technique is being used to
run Jenkins is
choosing 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java
as the Java which should run Jenkins.

Based on your report that maven is failing with a message about the wrong
java, I assume that the maven job which is failing is using an executor on
the Jenkins master.  Can you confirm that the failure happened when the job
ran on an executor on the Jenkins master?

If the failure is happening when the job runs on an executor on the master,
then you have a few choices.  You could:

   - Fix the environment in the script that launches the Jenkins master so
   that it uses the JDK you want instead of the JRE it is actually using now.
   That may require that you change the value of PATH.  It may require that
   you define JAVA_HOME.  In either case, Jenkins in your environment needs to
   run with a JDK, not a JRE.  It is currently running with a JRE.
   - Create a Jenkins agent configured to use the desired JDK and run the
   build on the Jenkins agent

Mark Waite


> which is yet another JVM installation.
>
>
>
> There is no additional “JAVA_HOME” environment variable.
>
>
>
> I am not really sure what you mean by
>
>
>
> “If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a
> JAVA_HOME defined in the context of that JDK tool?
>
>
>
> If you've defined a maven tool, is there a JAVA_HOME defined in the
> context of that maven tool?”
>
>
>
> I have defined my JDKs in the Configuration of Helpers and specified the
> JAVA_HOME for each one:
>
>
>
>
>
> There is no such settings for the maven installation and I am not able to
> specify one:
>
>
>
>
>
>
>
> BR
>
>
> Marco
>
>
>
> *Von:* jenkinsci-users@googlegroups.com 
> *Im Auftrag von *Mark Waite
> *Gesendet:* Montag, 11. November 2019 17:15
> *An:* Jenkins Users 
> *Betreff:* Re: How to force jenkins to use $JAVA_HOME/ instead of
> $JAVA_HOME/jre?
>
>
>
> Is there a JAVA_HOME environment variable reported in the Jenkins System
> Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?
>
>
>
> If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a
> JAVA_HOME defined in the context of that JDK tool?
>
>
>
> If you've defined a maven tool, is there a JAVA_HOME defined in the
> context of that maven tool?
>
>
>
> On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
> wrote:
>
> Hello,
>
>
>
>
>
> I have a Jenkins 2.190.2 running.
>
>
>
> I specified a custom JDK with “JAVA_HOME” set to `/opt/jdk8` which itself
> is a symbolic link to `/opt/oracle_jdk1.8.0_191`.
>
>
>
> Some of my maven builds are now breaking due to the javadoc executable not
> being found:
>
>
>
>
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on
> project XXX: MavenReportException: Error while generating Javadoc: Unable
> to find Javadoc command: The Javadoc executable
> ‘/opt/oracle_jdk1.8.0_191/jre/bin/javadoc’ doesn’t exist or is not a file.
> Verify the  parameter.
>
>
>
>
>
> Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
>
> Why is Jenkins referring to the jre subdirectory? When calling maven with
> the -X parameter I see that jenkins actually calls maven with
> `/opt/jdk8/bin/java`, but then sets the Java home to
> `/opt/oracle_jdk1.8.0_191/jre`:
>
>
>
>
>
> [XXX] $ /opt/jdk8/bin/java -cp
> /home/Jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:….
>
> …
>
> Java version: 1.8.0_191, vendor: Oracle Corporation, runtime:
> /opt/oracle_jdk1.8.0_191/jre
>
>
>
>
>
> I know that I could forcibly set the `` parameter to
> `${java.home}../bin/javadoc`, but that would be wrong, since $JAVA_HOME is
> /opt/jdk8, not /opt/jdk8/jre and it would break the build for all other
> cases than Jenkins.
>
>
>
> So how can I force Jenkins to use the correct $JAVA_HOME for building?
>
>
>
> BR
>
> Marco
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB31079EBED16FBFD216C46DB2E0740%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM
> 

AW: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-11 Thread Herrn, Marco
Hello Mark,

in the Jenkins System Information page I see the

“java.home” set to 
“/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre”

which is yet another JVM installation.

There is no additional “JAVA_HOME” environment variable.

I am not really sure what you mean by

“If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?”

I have defined my JDKs in the Configuration of Helpers and specified the 
JAVA_HOME for each one:

[cid:image001.jpg@01D59937.721B9940]

There is no such settings for the maven installation and I am not able to 
specify one:

[cid:image002.jpg@01D59937.721B9940]


BR

Marco

Von: jenkinsci-users@googlegroups.com  Im 
Auftrag von Mark Waite
Gesendet: Montag, 11. November 2019 17:15
An: Jenkins Users 
Betreff: Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

Is there a JAVA_HOME environment variable reported in the Jenkins System 
Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?

If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a JAVA_HOME 
defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context of 
that maven tool?

On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
mailto:marco.he...@siemens.com>> wrote:
Hello,


I have a Jenkins 2.190.2 running.

I specified a custom JDK with “JAVA_HOME” set to `/opt/jdk8` which itself is a 
symbolic link to `/opt/oracle_jdk1.8.0_191`.

Some of my maven builds are now breaking due to the javadoc executable not 
being found:


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on 
project XXX: MavenReportException: Error while generating Javadoc: Unable to 
find Javadoc command: The Javadoc executable 
‘/opt/oracle_jdk1.8.0_191/jre/bin/javadoc’ doesn’t exist or is not a file. 
Verify the  parameter.


Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
Why is Jenkins referring to the jre subdirectory? When calling maven with the 
-X parameter I see that jenkins actually calls maven with `/opt/jdk8/bin/java`, 
but then sets the Java home to `/opt/oracle_jdk1.8.0_191/jre`:


[XXX] $ /opt/jdk8/bin/java -cp 
/home/Jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:….
…
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: 
/opt/oracle_jdk1.8.0_191/jre


I know that I could forcibly set the `` parameter to 
`${java.home}../bin/javadoc`, but that would be wrong, since $JAVA_HOME is 
/opt/jdk8, not /opt/jdk8/jre and it would break the build for all other cases 
than Jenkins.

So how can I force Jenkins to use the correct $JAVA_HOME for building?

BR
Marco
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB31079EBED16FBFD216C46DB2E0740%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM.


--
Thanks!
Mark Waite
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFDmRe-DZKHQx_iMjShD0rCszJhkw%2Byg6-g9_FsipVMqA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-11 Thread Mark Waite
Is there a JAVA_HOME environment variable reported in the Jenkins System
Information page ("Jenkins" -> "Manage Jenkins" -> "System Information")?

If you've defined a JDK tool (or an AdoptOpenJDK tool), is there a
JAVA_HOME defined in the context of that JDK tool?

If you've defined a maven tool, is there a JAVA_HOME defined in the context
of that maven tool?

On Mon, Nov 11, 2019 at 8:57 AM Herrn, Marco 
wrote:

> Hello,
>
>
>
>
>
> I have a Jenkins 2.190.2 running.
>
>
>
> I specified a custom JDK with “JAVA_HOME” set to `/opt/jdk8` which itself
> is a symbolic link to `/opt/oracle_jdk1.8.0_191`.
>
>
>
> Some of my maven builds are now breaking due to the javadoc executable not
> being found:
>
>
>
>
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on
> project XXX: MavenReportException: Error while generating Javadoc: Unable
> to find Javadoc command: The Javadoc executable
> ‘/opt/oracle_jdk1.8.0_191/jre/bin/javadoc’ doesn’t exist or is not a file.
> Verify the  parameter.
>
>
>
>
>
> Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
>
> Why is Jenkins referring to the jre subdirectory? When calling maven with
> the -X parameter I see that jenkins actually calls maven with
> `/opt/jdk8/bin/java`, but then sets the Java home to
> `/opt/oracle_jdk1.8.0_191/jre`:
>
>
>
>
>
> [XXX] $ /opt/jdk8/bin/java -cp
> /home/Jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:….
>
> …
>
> Java version: 1.8.0_191, vendor: Oracle Corporation, runtime:
> /opt/oracle_jdk1.8.0_191/jre
>
>
>
>
>
> I know that I could forcibly set the `` parameter to
> `${java.home}../bin/javadoc`, but that would be wrong, since $JAVA_HOME is
> /opt/jdk8, not /opt/jdk8/jre and it would break the build for all other
> cases than Jenkins.
>
>
>
> So how can I force Jenkins to use the correct $JAVA_HOME for building?
>
>
>
> BR
>
> Marco
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB31079EBED16FBFD216C46DB2E0740%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM
> 
> .
>


-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtFDmRe-DZKHQx_iMjShD0rCszJhkw%2Byg6-g9_FsipVMqA%40mail.gmail.com.


How to force jenkins to use $JAVA_HOME/ instead of $JAVA_HOME/jre?

2019-11-11 Thread Herrn, Marco
Hello,


I have a Jenkins 2.190.2 running.

I specified a custom JDK with "JAVA_HOME" set to `/opt/jdk8` which itself is a 
symbolic link to `/opt/oracle_jdk1.8.0_191`.

Some of my maven builds are now breaking due to the javadoc executable not 
being found:


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on 
project XXX: MavenReportException: Error while generating Javadoc: Unable to 
find Javadoc command: The Javadoc executable 
'/opt/oracle_jdk1.8.0_191/jre/bin/javadoc' doesn't exist or is not a file. 
Verify the  parameter.


Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
Why is Jenkins referring to the jre subdirectory? When calling maven with the 
-X parameter I see that jenkins actually calls maven with `/opt/jdk8/bin/java`, 
but then sets the Java home to `/opt/oracle_jdk1.8.0_191/jre`:


[XXX] $ /opt/jdk8/bin/java -cp 
/home/Jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:
...
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: 
/opt/oracle_jdk1.8.0_191/jre


I know that I could forcibly set the `` parameter to 
`${java.home}../bin/javadoc`, but that would be wrong, since $JAVA_HOME is 
/opt/jdk8, not /opt/jdk8/jre and it would break the build for all other cases 
than Jenkins.

So how can I force Jenkins to use the correct $JAVA_HOME for building?

BR
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB31079EBED16FBFD216C46DB2E0740%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM.