[JAVA] I got an error when trying to install sbt to build a Scala development environment

Overview

――I was trying to build an environment to get my hands on Scala, but an error occurred when installing sbt.

version

updating Homebrew...
==> Auto-updated Homebrew!

Updated 1 tap (caskroom/cask).
No changes to formulae.

sbt: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!

You can install with Homebrew-Cask:
  brew cask install java

You can download from:
  https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.

--In short, I'm angry that you should install it because java is not included.

Steps in progress

However, java should have been installed because I proceeded with the following procedure before installing sbt.

brew cask install java
brew install scala

When I look it up

Reference URL In summary, java9 is included, but what sbt wants is java8. java9 was installed by brew cask install java. So, this can be solved by installing java8.

brew cask uninstall java
brew tap caskroom/versions
brew cask install java8
brew install sbt
$ sbt
[warn] No sbt.version set in project/build.properties, base directory: /Users/xxx/workspace/scala
-sample
[info] Set current project to scala-sample (in build file:/Users/xxx/workspace/scala-sample/)
[info] sbt server started at 127.0.0.1:5807
sbt:scala-sample>

After re-doing the above procedure, I was able to install sbt safely.

Summary

I hope it will be useful for people like me who have recently stumbled on the idea of "trying Scala for a while".

Recommended Posts

I got an error when trying to install sbt to build a Scala development environment
I was addicted to WSl when trying to build an android application development environment with Vue.js
I got an IllegalAccessError when trying to use PowerMock with JUnit
I tried to build an http2 development environment with Eclipse + Tomcat
I tried to build a Firebase application development environment with Docker in 2020
I get an error when adding a dependency
I got an error when I ran rake routes.
When I tried to build an environment of PHP7.4 + Apache + MySQL with Docker, I got stuck [Windows & Mac]
I built a CentOS 8 environment with Vagrant and tried to sync_folder, but I got an error, so I solved it.
When I bcrypt with node + docker, I got an error
Try to build a Java development environment using Docker
I tried to build an environment using Docker (beginner)
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
I got an error when using nextInt, nextLine and substring.
I tried to create a java8 development environment with Chocolatey
I tried to create a padrino development environment with Docker
[Docker] When I did docker-compose build, I got an error saying Can not read file. .. [Rails 6.0]
When trying to insert a specific gem (levenshtein) with Docker, an error occurred without ruby-dev
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
[Node.js] Docker-compose up makes it easy to build a development environment
[Programming beginner] What to do when rails s becomes an error in the local development environment
I tried to create a Spring MVC development environment on Mac
I get a Ruby version error when I try to start Rails.
I got an error and couldn't push! !! [error: failed to push some refs to]
I got a Permission Denied error when I put Laravel in Docker
What to do if you get a JNI shared library error when trying to build in Eclipse
I got stuck trying to write a where in clause in ActiveRecord
Steps to build a Ruby on Rails development environment with Vagrant
I tried to build a laravel operating environment while remembering Docker
I got a good punch when trying Hello World in Scala (object java.lang.Object in compiler mirror not found.)
What to do and how to install when an error occurs in DXRuby 1.4.7
01. I tried to build an environment with SpringBoot + IntelliJ + MySQL (MyBatis) (Windows10)
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
I want to display an error message when registering in the database
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Install PHP7.4 to build CentOS7 Laravel environment
Build a PureScript development environment with Docker
Error when trying to use heroku command
Build a Java development environment on Mac
Build a Wordpress development environment with Docker
A reminder when an aapt.exe error occurs
Build an Ultra96v2 development environment on Docker 1
Build a simple Docker + Django development environment
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
I get an error when I try to use "^" or "$" in ruby ​​regular expression
Solution that gives an error when trying to connect to DB (MySQL) in Java
Summary when trying to use Solr in Java and getting an error (Solr 6.x)
Build a development environment to create Ruby on Jets + React apps with Docker
407 error when trying to access an HTTPS site in Java via an authenticated proxy
Build a WordPress development environment quickly with Docker
When deploying to Heroku, OpenApp causes an error
Error summary when creating Minecraft MOD development environment
[Mockito] 3.2.4 → 3.3.x, but I got an error (Iketenai)
Build a simple Docker Compose + Django development environment
Build a Laravel environment on an AWS instance
Rails6.0 ~ How to create an eco-friendly development environment
[Win10] Build a JSF development environment with NetBeans
Build a development environment for Docker, java, vscode
[Rails] How to build an environment with Docker
How to build a Pytorch environment on Ubuntu
[First team development ②] Build an environment with Docker