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 trialGURVINDER SINGH
10,589 PointsInstalling Java REPL
I will really appreciate if people at treehouse can make a video lesson on how to install 'javarelp'. It turns out to be really difficult to install it on mac.
6 Answers
Ernest Grzybowski
Treehouse Project ReviewerIf you visit the video where the java-repl tool is first talked about, it has helpful links directly below the video in the "Teachers Notes".
If you go to the java-repl GitHub page it gives you the link to the download and tells you how to run it under "Usage".
I understand that most people aren't familiar with running jar files as programs, so I'll list this out step-by-step.
Step 1: Download java-repl.jar
Step 2:
Open a terminal and navigate to where the tool was downloaded to. If you downloaded it to your Downloads directory just type cd Downloads/
Step 3:
Run this command in the terminal to start the java-repl java -jar javarepl.jar
Step 4:
All done! Use ctrl+c
to terminate the utility.
Note: I changed your question from "Android" to "Java" because the java-repl tool is never talked about in the Android courses.
Reve Abi Khalil
Courses Plus Student 2,329 PointsI tried the same thing on windows this is what I'm getting: no main manifest attribute, in javarepl.jar
Waldo Alvarado
16,322 PointsErnest Grzybowski, thanks for you help but I'm getting this error when I try what you said:
" λ java -jar javarepl.jar Welcome to JavaREPL version 303 (Java HotSpot(TM) Client VM, Java 1.8.0_60)
ERROR: Java compiler not found. This can occur when JavaREPL was run with JRE instead of JDK or JDK is not configured correctly. "
I don't know what that means.
Jonathan Hector
5,225 Pointshttp://macappstore.org/javarepl/
Follow these instructions and javarepl will be installed in no time.
Michael Acosta Pegoraro
4,911 PointsIt's turns out to be easier than you think! I found an awesome way of installing a lot of tools via the terminal command.
I went here: http://brew.sh/
To install brew just run this on the terminal: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
it will ask for your/admin password.
Then install javarepl: brew install javarepl
To run it, just type: javarepl
Found the info here: https://www.learnhowtoprogram.com/lessons/java-repl
And you are good to go!
It's also helpful for installing other tools like download managers like wget that I use often on Linux. I switch between Mac and Linux so I am most of the time on the terminal. Even tho Treehouse has the workspace option to work on, I prefer to work local on my computer.
Jeff Bass
19,121 PointsSuper helpful! Thanks!
Sherrie Gossett
14,924 PointsPlus you get a nice mug of beer poured for you whenever you install something. https://www.dropbox.com/s/cmgewbz4j5c0qb0/beer.tiff?dl=0
Camille Pilon
4,708 PointsThanks for that! :)
Darin Thompson
5,305 PointsI am so thankful for this comment. I was racking my brain trying to figure out how to install this repl. I wasted a lot of time, kind of going through documentation and everything, I had it installed correctly but I kept running java-repl and was about to lose my mind as to why is wasn't working. Thankfully I came here not too long after my ordeal and found the command was actually javarepl no dash or space. Thanks a million.
Fergus Clare
12,120 Pointshome-brew is my favorite installation method! Thanks for this!
annient
Courses Plus Student 1,708 PointsI installed brew, and when I wanted to install javarepl with command brew install javarepl, terminal showed: -bash: brew: command not found What did I do wrong? Please help me :(
Jozef Bača
6,831 PointsThanks Ernest, i was searching for it for a long time. :) It is also good to create alias in .bashrc or .bash_aliases (this files should be located in your home folder) like this:
Step 1: Write this line into the file .bashrc or .bash_aliases: alias java-repl='java -jar path/to/file/javarepl.jar'
Step 2: To reload .bashrc or .bash_aliases, write this in terminal: source ~/.bashrc
or source ~/.bash_aliases
Step 3: All done! From now on you can run it from terminal by typeing: java-repl
Matthias Seeber
14,167 PointsI can't find the .bashrc file, can you help me to install the java -repl, so that I can run it from the terminal?
Waldo Alvarado
16,322 PointsHere's what I tried that worked for me.
In the Command line, once you're in the directory where you saved the javarepl.jar
(1) find the location (path) of where you installed you're JDK (java). In my case that was: C:\Program Files\Java\jdk1.7.0_79\bin
(2) Add a "\java" to that path so that you end up with: C:\Program Files\Java\jdk1.7.0_79\bin\java
(3) Encase it in quotes: "C:\Program Files\Java\jdk1.7.0_79\bin\java"
(4) Finally in type in: "C:\Program Files\Java\jdk1.7.0_79\bin\java" -jar javarepl.jar then hit enter and if it works you should see this--------->
Welcome to JavaREPL version 303 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_79) Type expression to evaluate, :help for more options or press tab to auto-complete. java>
Steve Dutky
5,290 Pointshttp://albertlatacz.published.s3.amazonaws.com/javarepl/javarepl.jar updated from link above worked for me
Jozef Bača
6,831 PointsHi Matthias, i was out from treehouse for a while, so sorry for delay. You are able to find .bashrc in your home folder only when you try install javarepl on linux. But some versions of linux use a different bash, so you need to find out which type of bash you have on your linux distro. And also file is hidden so maybe if you setup to view hidden files, you will find .bashrc. Dot at the beginning of file name, means that the file is hidden.
Jonathan Hector
5,225 PointsJonathan Hector
5,225 Pointshttp://macappstore.org/javarepl/
Follow these instructions and javarepl will be installed in no time.