-bash: scala: command not found - macos

I'm trying to install scala on my mac (Maverick).
I downloaded and unarchived it.
I then put myself from where it was unarchived and inside the /bin folder in the terminal.
But when I run "scala" or "scalac" I get :
-bash: scala: command not found
Why?

I always suggest that mac users install homebrew and use homebrew as their primary package installer to install software.
Installing scala is as simple as
brew install scala
Homebrew will also install/fix java dependencies for you and handle path issues (I believe)

I get the same issue and quickly I found everything is fine, if you write the correct path into your .bash_profile.
The only thing you need is to close current terminal and open a new one, on which Scala would work.
Hope this work for you.

do you have Java installed and available on your PATH http://sourabhbajaj.com/mac-setup/Java/README.html the same author also provides good Scala / SBT setup info http://sourabhbajaj.com/mac-setup/Java/README.html

Related

idb-companion: command not found after installing via homebrew

I have installed idb-companion in line with the instructions in their docs, but when I run idb list-targets I get idb: command not found. idb-companion shows up when I brew list. I also tried installing and running the universal .tar.gz folder from their latest release, but got no where. Although I only ran that via the Finder GUI, because I wasn't sure how to execute that from the CLI.
I understand there is some homebrew path I may have to change. I have actually had homebrew issues before and so have usually resorted to installing everything via node where possible. In this case it's not, so I tried the .tar.gz file.
How can I get idb-companion to start working properly?
Most likely it is the case, your python path is not set. You need to set your python path. Faced the same issue was resolved with setting python path.

Bad Interpreter No Such File or Directory - Docker Sync

When trying to start my Docker container and sync it up using Debian, I consistently encounter this error message after entering in "docker-sync-stack start"...
-bash: /c/RailsInstaller/Ruby2.3.3/bin/docker-sync: C:/RailsInstaller/Ruby2.3.3/bin/ruby.exe: bad interpreter: No such file or directory
I'm fairly sure this is a path issue, but I can't seem to resolve it.
It seems you do not have Ruby installed on your system. That sometimes happens after a system upgrade.
There have been discussions about this
here: https://github.com/EugenMayer/docker-sync/issues/683
here: https://github.com/EugenMayer/docker-sync/issues/679
In general your system cannot find ruby, or your system (with the current ruby version used) cannot find the docker-sync plugin. So you need to reinstall the plugin then.
This happened to me also after updating to Catalina. Fixed by running brew reinstall ruby and brew reinstall docker-sync.

Installing Typesafe activator on OSX

I am trying to install the typesafe activator (scala, AKKA, play framework, activator)
I have Yosemite OSX
My bash is Oh my ZSH
I already have JDK 1.7, installed and exported
I downloaded and unzipped the file "typesafe-activator-1.2.10-minimal". Finally I put the export path on my ~/.zshrc
but when I type activator on the terminal it prints that cant find the file
thank you
get HomeBrew.
play documentation says this :
Play install on mac
But there have been some changes to that. Now you have to do this.
Try this:
brew install typesafe-activator
And then use activator command to start it
I made a big mistake, In the ~/.zshrc where I should put
export PATH=$PATH:/relativePath/to/activator
I added the executable file to the path. I post this answer in case is helpful for someone else.
For people like me, who are reading this in 2019 (or later) and are unable to find activator recipee in homebrew, be informed that activator has been decommissioned
Good news is, it's fairly simple to create new projects (including templates for play, akka etc.) with sbt new command and Giter8 templates.
Open terminal and follow the below steps,
mkdir ~/bin
ln -s <path to your play home>/activator ~/bin
echo "export PATH=~/bin:$PATH" >> ~/.bashrc
. ~/.bashrc
These days, in 2020, it seems Activator isn't available from Homebrew anymore?
But old Activator releases remain downloadable, from e.g. https://downloads.typesafe.com/typesafe-activator/1.3.6/typesafe-activator-1.3.6.zip. (I assume other version numbers work as well.)
export PATH=$PATH:/Users/XXX/XXX/activator-dist-1.3.12/bin

Grails Mac OSX Install via Brew Restarting terminal

I've been trying to get past step one of installing grails, which is bad i know. But the issue im having is getting grails to work via the OSX terminal. similar to node using brew I type the command
brew install grails
this retrieves grails and installs it, simple. to see if its installed correctly you type grails -version
However when i do that it's as though my terminal restarts. Its a hard thing to describe so here is a link to a youtube video that shows you what happens. I have JAVA installed and working. Anyone have an idea?
https://www.youtube.com/watch?v=ButLwGfBTZo
As this is the first excursion I have had into any Java related development. I made a rookie mistake and was unaware of vital piece of information. You do not need Java to run Grails you need the Java Development Kit (JDK). Which is a different thing completely apparently.
Available here
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Once installed run this command in the terminal /usr/libexec/java_home -V This will show you all of the current Java Virtual Machines installed. In my case
Matching Java Virtual Machines (1):
1.8.0_11, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
You then need to set your JAVA_HOME Environment variable to point to your JVM. Like so export JAVA_HOME=$(/usr/libexec/java_home) use /usr/libexec/java_home rather than the true location as this will specifi the version set in Java Preferences for the current user. The source for that nice little trick is here http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/
Once you've done that you can type the command brew install grails or gvm install grails which is what i should probably use rather than brew as "SurrealAnalysis" rightly pointed out in one of the answers.
moment of truth grails -version and i got a response Grails version: 2.4.3... sweet.
Thank you all for the replies and help.
Following previous post, GVM it is not available in Homebrew, because of this.
GDK is also now officially SDKMAN!.
So, the steps would be:
curl -s "https://get.sdkman.io" | bash
source "/Users/{YOUR_USER_NAME}/.sdkman/bin/sdkman-init.sh"
sdk install groovy
Hope it helps! :)

Is there a nice and easy installer for Clojure on Mac OS (Leopard)?

I found the following guide:
http://mark.reid.name/sap/setting-up-clojure.html
but it seems like a whole lot of manual steps, and I bet it is out of date already. Installing ClojureBox on Windows was a breeze. Does anyone know of a simple installer for it? Where can I download it, and what are the steps?
Thanks!
EDIT: Tried installing cake, got:
$ sudo gem install cake
Password:
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302
Also tried installing using the script:
$ sudo ./cake_install.rb
http://github.com/ninjudd/cake-standalone/raw/master/jars/cake-0.5.4.jar
[=============================================================================]
http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar
[=============================================================================]
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
EDIT 2: Now the Java version issues :) What version of Java do I need and where to download it?
$ sudo cake test
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file (ordered_set.clj:1)
My Leopard software is up to date :(
Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac. If you have problems with downloading, installing or using Java on Mac, please contact Apple Computer Technical Support.
EDIT: Hm ... I suspect that one of the suggestions I tried broke my ability to connect to the internet (both wired as well as wireless) on Apple :(
Clojure is also installable via Homebrew:
http://github.com/mxcl/homebrew
brew install clojure
If you just want to run clojure programs, then macports works. Bear in mind you're dependent upon the maintainer to update versions.
If you plan on writing clojure programs, then cake is a better starting point. Installation involves one of the following (your choice):
Using gem (easiest)
gem install cake
Standalone script
Download the script
Put it somewhere in your path and chmod +x cake to make it executable
Git repository
git clone git://github.com/ninjudd/cake.git
Symlink bin/cake into your path and make it executable
Cake is a full build system, but you can just use it to fire up the repl by running cake repl. There's also leiningen, but starting repls will feel faster in cake since it uses persistent JVMs.
I find Leiningen very easy to use. Just download the script, put it somewhere in your $PATH (/usr/bin/ for example) and make it executable: sudo chmod +x lein.
Now type lein repl and Leiningen will download all the files you need and create a REPL for you. It's that easy.
You may want to check CounterClockWise (an Eclipse plugin). There's a video on how to install it here. It'll give you a lot of features to play with - including a clojure REPL.
Just checked this will still work under Ubuntu. It should be the same for macs, except using whatever macs use instead of apt-get to install maven:
http://www.learningclojure.com/2010/08/clojure-emacs-swank-slime-maven-maven.html
You need to install maven, create a file, then you can just call mvn clojure:repl and everything should just work.
If you'd also like the whole emacs-swank-slime setup that's also easy now, and described there.
If you try it can you comment back here or on the blog to let me know if there are any changes I need to make for macs?
Install MacPorts and then run sudo port install clojure
I once created a package called ClojureX that was partly based on Mark's article. It's not actively maintained anymore (at least not by me), but there's no reason it wouldn't work:
http://github.com/citizen428/ClojureX

Resources