Skip to content
Permalink
Browse files

Merge pull request #101 from raul-arabaolaza/JENKINS-45287

[JENKINS-45287] Debian packaging should not be satisfied by Java 9
  • Loading branch information
svanoort committed Jul 19, 2017
2 parents 3835c07 + d3f21f5 commit e3ddccea97cac6649b8136e8bc574583f5df6fca
Showing with 40 additions and 4 deletions.
  1. +1 −1 deb/build/debian/control
  2. +0 −3 deb/build/debian/jenkins.default
  3. +23 −0 deb/build/debian/jenkins.init
  4. +16 −0 deb/publish/gen.rb
@@ -8,7 +8,7 @@ Homepage: @@HOMEPAGE@@

Package: @@ARTIFACTNAME@@
Architecture: all
Depends: ${misc:Depends}, daemon, adduser, procps, psmisc, net-tools, default-jre-headless (>= 2:1.8) | java8-runtime-headless
Depends: ${misc:Depends}, daemon, adduser, procps, psmisc, net-tools
Conflicts: hudson
Replaces: hudson
Description: @@DESCRIPTION_FILE@@
@@ -3,9 +3,6 @@
# pulled in from the init script; makes things easier.
NAME=@@ARTIFACTNAME@@

# location of java
JAVA=/usr/bin/java

# arguments to pass to java

# Allow graphs etc. to work even when an X server is present
@@ -24,6 +24,9 @@ SCRIPTNAME=/etc/init.d/$NAME
#DAEMON=$JENKINS_SH
DAEMON=/usr/bin/daemon
DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=$JENKINS_HOME --output=$JENKINS_LOG --pidfile=$PIDFILE"
JAVA=`type -p java`

JAVA_ALLOWED_VERSION="18"

if [ -n "$UMASK" ]; then
DAEMON_ARGS="$DAEMON_ARGS --umask=$UMASK"
@@ -43,6 +46,26 @@ if [ "$RUN_STANDALONE" = "false" ]; then
exit 1
fi

# Make sure there exists a java executable, it may not be allways the case
if [ -z "$JAVA" ]; then
echo "ERROR: No Java executable found in current PATH: $PATH" >&2
echo "If you actually have java installed on the system make sure the executable is in the aforementioned path and that 'type -p java' returns the java executable path" >&2
exit 1
fi

# Work out the JAVA version we are working with:
JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\(.*\)\.\(.*\)\..*"/\1\2/p;')

if [ "$JAVA_VERSION" = "$JAVA_ALLOWED_VERSION" ]; then
echo "Correct java version found" >&2
else
echo "Found an incorrect Java version" >&2
echo "Java version found:" >&2
echo $($JAVA -version) >&2
echo "Aborting" >&2
exit 1
fi

# load environments
if [ -r /etc/default/locale ]; then
. /etc/default/locale
@@ -31,6 +31,21 @@
<pre style="padding:0.5em; margin:1em; background-color:black; color:white">
deb #{url} binary/
</pre>
</p>
<p>
You will need to explicitly install a Java runtime environment, <b>because Jenkins does not work with Java 9</b>, this is the safest way to
ensure your system ends properly configured. Adding an explicit dependency requirement on Java could force installation
of undesired versions of the JVM. Check <a href="https://issues.jenkins-ci.org/browse/JENKINS-40689">JENKINS-40689</a>
for more details about Jenkins and Java 9 compatibility.
</p>
<p>
<ul>
<li>2.54 (2017-04) and newer: Java 8</li>
<li>1.612 (2015-05) and newer: Java 7</li>
</ul>
</p>
<p>
Update your local package index, then finally install #{productName}:
@@ -39,6 +54,7 @@
sudo apt-get update
sudo apt-get install #{artifactName}
</pre>
</p>
<p>
See <a href="http://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu">Wiki</a> for more information, including notes regarding upgrade from Hudson.

0 comments on commit e3ddcce

Please sign in to comment.
You can’t perform that action at this time.