Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAni Azot
1,754 PointsI can't start java-repl from the workspace console
I get this error in the console when attempting to start java-repl
treehouse:~/workspace$ java-repl bash: /lib.jvm/java-1.8.0/bin/java: No such file or directory
I've tried closing and reopening the console but it doesn't work. Also, I can't start jshell either in this workspace.
Tracy Chacon
7,372 PointsSame here...
Ani Azot
1,754 Pointsok I barely know a few fragments of the linux terminal but I think I've got jshell working.
I found that if you run the command (from the workspace console) cd /opt/jdk-9/bin ./jshell
this should run jshell
I'll see if I can find where java-repl is installed and maybe we can run it manually using a similar command
Donald Fawcett
600 PointsHi Ani, I have the same problem with jshell error, I tried the solution you suggested running the command (from the workspace console) cd /opt/jdk-9/bin ./jshell but that didn't work for me....
???
Ani Azot
1,754 Pointsyou have to run the commands on separate lines.
first: cd /opt/jdk-9/bin second: ./jshell
Donald Fawcett
600 PointsYeah got it, thanks Ani for the solution.
Others have been having this problem in the last few hours (https://teamtreehouse.com/community/no-jshell) so seems something is broken in the workspace so I will email treehouse support, hopefully be fixed soon after...
Ani Azot
1,754 Pointsok so I've figured out how to run java-repl.
[JAVA-REPL] From the console
first: cd /opt/jdk1.8.0_171/bin/
second: java -jar /usr/share/java/java-repl.jar
[JSHELL] From the console
first: cd /opt/jdk-9/bin
second: ./jshell
this should allow you to run java-repl. It looks like the links in .bashrc are pointing to directories which do not exist but this should be a workaround for anyone struggling to run jshell or java-repl
Ani Azot
1,754 Pointsthanks Donald Fawcett I've emailed them also.
Ani Azot
1,754 Pointsok so I found that if you load java-repl as I did above you might not be able to load any files. I'm guessing because of the workspace file path context missing after the cd command.
to get around this open a workspace as normal and in the console directly after treehouse:/~workspace$
type:
/opt/jdk1.8.0_171/bin/java -jar /usr/share/java/java-repl.jar
This should load java-repl and allow you to load your .java classes etc using the normal package syntax .
sorry about that.
4 Answers
Craig Dennis
Treehouse TeacherHey y'all!
This is all fixed and will work like expected, awesome job finding workarounds!
Thanks for raising this to our attention, and sorry for the confusion!
Tracy Chacon
7,372 PointsI just installed java and ran jshell from the command line.
Donald Fawcett
600 PointsYeah that will work but doesn't solve the issue of jshell apparently not being accessible from workspaces in treehouse at the moment. I emailed treehouse support about the issue, in the meantime Ani's workaround provides a solution that allows jshell session to be started from workspace.
Tracy Chacon
7,372 PointsJshell from the command line on your own computer or from the workspace CMI works exactly the same. If you change your mind about installing JAVA I'm happy to help.
Ani Azot
1,754 PointsAni Azot
1,754 PointsI've tried other workspaces and I can't start jshell or java-repl in any of these.