Enabling JMX remote agent on Java9 - jmx

I am trying to run a simple application with the JMX remote agent enabled.
While it runs perfectly on older VM's, it fails on Java9 VM.
$ java -Dcom.sun.management.jmxremote Hello
Error: Config file not found: /usr/lib/jvm/java-9-openjdk-amd64/conf/management/management.properties
$ java -version
openjdk version "9-Debian"
OpenJDK Runtime Environment (build 9-Debian+0-9b149-1)
OpenJDK 64-Bit Server VM (build 9-Debian+0-9b149-1, mixed mode)
Ho can I fix that?
Moshe

Related

while starting jenkins in tomcat it shows FAIL - Application at context path [/jenkins] could not be started

I installed and strated apache tomcat on my windows 10. after that I added war file of jenkins in the web page of tomcat.
Now I am going to start the jenkins it will show the following message
I also check the compatibility version of java for jenkins and installed successfully.Then also jenkins not started

Running Junits which supports Java 8 on EC2 with Jenkins & Java 11

I have a basic question, I am trying to install jenkins on AWS EC2 ubantu instance.
I see Jenkins requires Java 11 to use newer versions - https://www.jenkins.io/doc/tutorials/tutorial-for-installing-jenkins-on-AWS/
I am planning to run junit tests which supports Java 8 on Jeknins node.
If I install Jenkins with Java 11 on EC2, does it impacts executing junits tests?
UPDATED:
Why Install automatically doesn't show list of options to select jdk versions?

Jenkins error: "ERROR: Unable to install JDK unless a valid username/password is provided."

I have added a new slave to my jenkins server, the connection itself seemed to go successfully via ssh, however when I try to build on that server the Job tries to download Java on the slave(even though java is all-ready installed on that server) and im getting the following Error:
Downloading JDK from http://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
Your Oracle account doesn't appear valid. Please specify a valid username/password
ERROR: Unable to install JDK unless a valid username/password is provided.
Finished: FAILURE
This is the output of java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
what do I need to do here? reinstall java manually?
I was stuck with same error, banged my head for hours but no luck. But finallly the answer was jdk configuration on the master jenkins.
Writing this answer as i couldnt find much on this over internet.
Go to Manage Jenkins -> Global tool configuration
and check the configuration for JDK in JDK installation.
Uncheck the install automatically checkbox as this will be forcing jdk installations on every slave.
If you want this option enabled then you have to give oracle account credentials which to be used by the jenkins to download the jdk.
If you already have java installed on your slaves then you would be better to uncheck the checkbox.
You can set the default credentials for Oracle here:
http://<hostname>/descriptorByName/hudson.tools.JDKInstaller/enterCredential
hostname being your Jenkins URL.
Thanks
Tool Locations
The above two answers didn't work for me. But this did: at the bottom of your node configuration page, set one of your tools to be your JDK:
In fact, I needed to do the same thing with Maven.
Just set the JAVA_HOME in your Jenkins slave so it doesn't try to install another Java.

Jenkins slave creation for Windows server

I am trying to use jekins for deployment of my patch so here the server on which I want to deploy is a Windows server and my Jenkins is a Aix system and also my Jenkins version is 2.9 and it's run on java 7 where as the application I am deploying has a constraint that it could only be run on java 6 which is on Windows hence I need a solution for this java 7 to to java 6 slave connection.
I have resolved this issue by just installing a java 7 on the windows server with the constraint,
but the java 7 isn't configured in the path variable i have kept a command handy with the complete path of bin directory of the java 7 installed on the windows so i can connect via slave.jar to my jenkins server giving the path and executing the slave.jar with java 7 so that i dont get a major minor version error, and later on since its not in the path further use java 6 for later processing of windows server.

Installing hudson slave agent as a service

I'd like to set up a Hudson slave agent (v3.2.2) as a Windows service on one of my Windows nodes (running Windows 8.1 x64 with .NET 3.5 installed). As of this wiki page, there should be a File > Install as Windows Service menu option. But when I run the JNLP, there's no such option:
So: How do I install the Hudson slave agent as a Windows service?
There is a bug that has been submitted for this, Bug 427526, and also a workaround. It is related to the version of Java. I used JDK 7u11 and I got the File option and was able to install the slave as a service.

Resources