Java 9 jshell OSX bug workaround

Java logo

Java 9 jshell

You’ve downloaded the current build of Java 9, and perhaps Kulla. You try to run jshell and blammo. Stack dump.

Introduction

Table of Contents

So, you’ve installed Java 9 on your Mac. Maybe one of the Early Access builds. I’m playing around with modules, so I’m using the Jigsaw version.

Let’s check.

Let’s run jshell.

D’oh!

Ok, let’s try it with a pre-built kulla.jar from the AdoptOpenJDK Cloudbees instance

Same nonsense.

I even downloaded the kulla sources and built them. No difference.

The Workaround

Table of Contents

Add your hostname to /etc/hosts.

(My hostname is rockhopper – the penguin of course, not the bike).

Summary

Table of Contents

A simple /etc/hosts one liner fixes the problem.

Yay! Now I can use Java as I’ve used LISP since the 80s!

Resources

Table of Contents

Share These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Facebook
  • Twitter
  • LinkedIn
  • email
  • DZone
  • Slashdot
  • Reddit
  • Google Bookmarks
  • Digg
  • StumbleUpon
  • del.icio.us
This entry was posted in Java and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

5 Comments

  1. Declan Qian
    Posted May 31, 2016 at 11:03 pm | Permalink

    How do you find out about this? It works after I add that line with my hostname. I have been trying to find a workaround for 2 days already. Almost the same path you do. Tried openjdk preview, AdoptOpenJDK Cloudbees instance, build on my computer and even http://zulu.org/zulu-9-pre-release-downloads/. Same things.
    There is a ticket in here:https://bugs.openjdk.java.net/browse/JDK-8131029. Should be fixed anytime soon.

    Thanks for sharing this.

    • Gene De Lisa
      Posted June 1, 2016 at 10:46 am | Permalink

      I found it through much cursing

  2. Thaneesh Gupta
    Posted June 1, 2016 at 8:33 pm | Permalink

    Still does not work for me. I typed exactly the word ‘rockhopper’ into my /etc/hosts file but alas this was to no avail. I think perhaps you are mistaked about this technique is good approach to fix the bug.

    • Gene De Lisa
      Posted June 2, 2016 at 7:13 am | Permalink

      Perhaps you mistaked[sic] understanding the line “Add your hostname to /etc/hosts.”

    • A Grover
      Posted June 30, 2016 at 4:16 pm | Permalink

      This is the right solution.
      Try running the hostname command. the use the hostname from output of that command in /etc/hosts.

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">