diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java index ec5bc39dec6..ae9201906c3 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/JavaVersion.java @@ -38,7 +38,7 @@ public class JavaVersion private static final String UPDATE = "(?:(?_)(?[0-9]+))?"; private static final String PRE = "(?:-(?
[a-zA-Z0-9]+))?";
     private static final String BUILD = "(?:(?\\+)(?[0-9]+))?";
-    private static final String OPT = "(?:-(?[-a-zA-Z0-9.]+))?";
+    private static final String OPT = "(?:-(?[-a-zA-Z0-9.~]+))?";
 
     private static final String VSTR_FORMAT = VNUM + UPDATE + PRE + BUILD + OPT;
 
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
index 47049ee8892..3c47bf4a353 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/JavaVersionTest.java
@@ -148,4 +148,17 @@ public class JavaVersionTest
         assertThat(version.getUpdate(),is(0));
         assertThat(version.getSuffix(),is("Ubuntu-9b181-4")); 
     }
+    
+    @Test
+    public void testUbuntu8()
+    {
+        JavaVersion version = JavaVersion.parse("1.8.0_151-8u151-b12-1~deb9u1-b12");
+        assertThat(version.getPlatform(),is(8));
+        assertThat(version.getMajor(),is(1));
+        assertThat(version.getMinor(),is(8));
+        assertThat(version.getMicro(),is(0));
+        assertThat(version.getUpdate(),is(151));
+        assertThat(version.getSuffix(),is("8u151-b12-1~deb9u1-b12")); 
+    }
+    
 }