The following script: var Thread = java.lang.Thread; function test_thread() { var line = 'content-type: text/html'; while (1) { Thread.sleep(100); line.split(/: /); } } for (var i=0; i<5; i++) { new Thread(test_thread).start(); } while (1) { Thread.sleep(1000); } Throws: java.lang.NullPointerException at jdk.nashorn.internal.runtime.regexp.joni.Regex.matcher(Regex.java:148) at jdk.nashorn.internal.runtime.regexp.joni.Regex.matcher(Regex.java:143) at jdk.nashorn.internal.runtime.regexp.JoniRegExp$JoniMatcher.<init>(JoniRegExp.java:126) at jdk.nashorn.internal.runtime.regexp.JoniRegExp.match(JoniRegExp.java:101) at jdk.nashorn.internal.objects.NativeRegExp.execSplit(NativeRegExp.java:581) at jdk.nashorn.internal.objects.NativeRegExp.split(NativeRegExp.java:824) at jdk.nashorn.internal.objects.NativeString.split(NativeString.java:878)