Skip to content

Commit

Permalink
Merge pull request #101 from raul-arabaolaza/JENKINS-45287
Browse files Browse the repository at this point in the history
[JENKINS-45287] Debian packaging should not be satisfied by Java 9
  • Loading branch information
svanoort committed Jul 19, 2017
2 parents 3835c07 + d3f21f5 commit e3ddcce
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deb/build/debian/control
Expand Up @@ -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 changes: 0 additions & 3 deletions deb/build/debian/jenkins.default
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions deb/build/debian/jenkins.init
Expand Up @@ -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"
Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions deb/publish/gen.rb
Expand Up @@ -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}:
Expand All @@ -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.
Expand Down

0 comments on commit e3ddcce

Please sign in to comment.