Skip to content

Commit e13f56a

Browse files
committed
Add separate download pages for Scala 2 and Scala 3
1 parent 8b27556 commit e13f56a

File tree

11 files changed

+517
-183
lines changed

11 files changed

+517
-183
lines changed

_downloads/2021-05-14-3.0.0.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Scala 3.0.0
3+
start: 14 May 2021
4+
layout: downloadpage
5+
release_version: 3.0.0
6+
release_date: "May 14, 2021"
7+
permalink: /download/3.0.0.html
8+
license: <a href="https://www.scala-lang.org/license/">Apache License, Version 2.0</a>
9+
---

_includes/downloads-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
{% endif %}
1717
{% endfor %}
1818
{% endfor %}
19-
{% endfor %}
19+
{% endfor %}

_includes/downloads-scala2.html

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<h2>The most popular way to get Scala is either using Scala through sbt, the Scala build tool, or to use Scala through an IDE.</h2>
2+
<div class="install-steps">
3+
<div class="step arrow">
4+
<img src="/resources/img/download/arrow-asset.png" alt="">
5+
<div class="number-step">1</div>
6+
<div class="text-step">
7+
<h3>First, make sure you have the Java 8 JDK (or Java 11 JDK) installed.</h3>
8+
<p>To check, open the terminal and type:</p>
9+
<p><code>java -version</code><span>(Make sure you have version 1.8 or 11.)</span></p>
10+
<p><i>(If you don't have it installed, download Java from <a href="https://www.oracle.com/java/technologies/javase-jdk8-downloads.html">Oracle Java 8</a>, <a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html">Oracle Java 11</a>, or <a href="https://adoptopenjdk.net/">AdoptOpenJDK 8/11</a>. Refer <a href="https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html">JDK Compatibility</a> for Scala/Java compatiblity detail.</i></p>
11+
</div>
12+
</div>
13+
<div class="step">
14+
<div class="number-step">2</div>
15+
<div class="text-step">
16+
<h3>Then, install Scala:</h3>
17+
<p>...either by installing an IDE such as IntelliJ, or sbt, Scala's build tool.</p>
18+
</div>
19+
</div>
20+
<div class="download-options">
21+
<div class="download-left">
22+
<span class="or">or</span>
23+
<div class="description">
24+
<img src="/resources/img/download/arrow-left.png" alt="">
25+
<p>Best if you prefer a full-featured IDE (recommended for beginners)</p>
26+
</div>
27+
<a href="" class="btn-download" id="download-intellij-link">
28+
<i class="fa fa-download"></i>
29+
<span>Download intellij</span>
30+
</a>
31+
<ul>
32+
{% include tutorial-list.html column=1 %}
33+
</ul>
34+
</div>
35+
<div class="download-right">
36+
<div class="description">
37+
<img src="/resources/img/download/arrow-right.png" alt="">
38+
<p>Best if you are familiar with the command line</p>
39+
</div>
40+
<a href="" class="btn-download" id="download-sbt-link">
41+
<i class="fa fa-download"></i>
42+
<span>Download Sbt</span>
43+
</a>
44+
<ul>
45+
{% include tutorial-list.html column=0 %}
46+
</ul>
47+
</div>
48+
</div>
49+
50+
<p class="bottom-lead">
51+
Compared to other programming languages, installing Scala is a bit unusual. Scala is unusual because it is usually installed for each of your Scala projects rather than being installed system-wide. Both of the above options manage (via sbt) a specific Scala version per Scala project you create.
52+
<br><br>
53+
But it's also possible to "install" Scala in numerous other ways; e.g., grab Scala binaries and use Scala from the command line or use Scala in your browser!
54+
<br><br>
55+
</p>
56+
57+
<!-- <p class="bottom-lead"><h2>Other</h2></p> -->
58+
59+
<div class="step other-ways-lead">
60+
<div class="number-step"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></div>
61+
<div class="text-step">
62+
<h2>Other ways to install Scala</h2>
63+
<ul>
64+
<li>
65+
<a id="download-binaries">Download the Scala binaries for <span id="users-os"></span></a>
66+
<br/><span class="install"><a href="{{ site.baseurl }}/download/install.html">Need help running the binaries?</a></span>
67+
</li>
68+
<li>Using <a href="https://sdkman.io/">SDKMAN!</a>, you can easily <a href="https://sdkman.io/sdks#scala">install Scala</a> with <code>sdk install scala</code></li>
69+
<li>On macOS you can also use <a href="https://brew.sh/">Homebrew</a> and existing <a href="https://formulae.brew.sh/formula/scala">Scala Formulae</a><br/><code>brew update</code><br/><code>brew install scala</code></li>
70+
<li>With <a href="https://www.macports.org/">MacPorts</a>, you can get Scala using <code>sudo port install scala2.x</code>command.<br/> For example to install Scala 2.12 simply use<code>sudo port install scala2.12</code></li>
71+
<li>Use <a href="https://scastie.scala-lang.org">Scastie</a> to run single-file Scala programs in your browser using multiple Scala compilers; the production Scala 2.x compilers, Scala.js, Dotty, and Typelevel Scala. Save and share executable Scala code snippets.</li>
72+
<li>Try Scala in the browser via <a href="https://scalafiddle.io/">ScalaFiddle</a>. This lets you run single-file Scala programs in your browser using Scala.js, including graphical/interactive examples such as <a href="https://scalafiddle.io/sf/KOsXSKv/0">Oscilloscope</a> or <a href="https://scalafiddle.io/sf/4beVrVc/1">Ray Tracer</a></li>
73+
<li><a href="https://ammonite.io/">Get Ammonite</a>, a popular Scala REPL</li>
74+
</ul>
75+
<p>Or are you looking for <a href="{{ site.baseurl }}/download/all.html">previous releases</a> of Scala?</p>
76+
</div>
77+
</div>
78+
79+
80+
<h3>Release Notes</h3>
81+
For a summary of important changes, see the <a href="https://github.com/scala/scala/releases">GitHub release notes</a>.
82+
<br/><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release notes</a>.)</small>
83+
84+
{% include download-resource-list.html %}
85+
<h3>License</h3>
86+
<p>The Scala distribution is released under the {{page.license}}.</p>
87+
</div>

_includes/downloads-scala3.html

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
Scala binaries for <strong>{{page.release_version}}</strong> are available at <a href="https://github.com/lampepfl/dotty/releases/tag/{{page.release_version}}">github</a>.
2+
3+
<h2>Getting Started with Scala</h2>
4+
<div class="install-steps">
5+
<p>
6+
Depending on your experience and your requirements, there exist two ways to
7+
install Scala 3 on your computer,
8+
either through <a href="https://www.scala-sbt.org/download.html">sbt</a>, or
9+
through <a href="https://get-coursier.io/docs/cli-installation">Coursier</a>.
10+
</p>
11+
12+
<div class="download-options">
13+
<div class="download-left">
14+
<span class="or">or</span>
15+
<a href="https://get-coursier.io/docs/cli-installation" class="btn-download">
16+
<i class="fa fa-download"></i>
17+
<span>Download Coursier</span>
18+
</a>
19+
<div class="text-variant">
20+
<p>Best if you want to get <strong>started quickly</strong>.</p>
21+
<p><i>Coursier will install all the necessary dependencies for you, so after
22+
installing Coursier you are ready to go.</i></p>
23+
</div>
24+
</div>
25+
<div class="download-right">
26+
<a href="https://www.scala-sbt.org/download.html" class="btn-download">
27+
<i class="fa fa-download"></i>
28+
<span>Download Sbt</span>
29+
</a>
30+
<div class="text-variant">
31+
<p>Best if you want to work on <strong>larger projects</strong>.</p>
32+
<p><i>If you already have sbt installed, it is very easy to switch to Scala version {{page.release_version}}.</i></p>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
38+
<h2>Installing Scala 3 with <strong>Coursier</strong></h2>
39+
<div class="install-steps">
40+
<div class="step arrow">
41+
<img src="/resources/img/download/arrow-asset.png" alt="">
42+
<div class="number-step">1</div>
43+
<div class="text-step">
44+
<h3>Install the <i>Coursier</i> Scala artifact fetcher.</h3>
45+
<p>Visit the <a href="https://get-coursier.io/">Coursier website</a> for detailed installation instructions on how to install Coursier.</p>
46+
<p><i>(Coursier is the simplest way to get started with Scala, since it will automatically download and install all necessary dependencies for you).</i></p>
47+
</div>
48+
</div>
49+
<!-- <div class="step">
50+
<div class="number-step">2</div>
51+
<div class="text-step">
52+
<h3>Then, prepare your environment</h3>
53+
<p>Open a terminal and run the following command: <code>cs setup</code></p>
54+
<p><i>(Running this <a href="https://get-coursier.io/docs/cli-setup">command</a> installs the correct Java version along with some other helpful command line tools).</i></p>
55+
</div>
56+
</div> -->
57+
<div class="step arrow">
58+
<img src="/resources/img/download/arrow-asset.png" alt="">
59+
<div class="number-step">2</div>
60+
<div class="text-step">
61+
<h3>Then, install Scala 3</h3>
62+
<p>Open a terminal and run the following commands:</p>
63+
<p><code>cs install scala3-compiler</code><span>to install the Scala 3 compiler</span></p>
64+
<p><code>cs install scala3-repl</code><span>to install the Scala 3 interactive read-eval-print loop</span></p>
65+
</div>
66+
</div>
67+
<div class="step">
68+
<div class="number-step">3</div>
69+
<div class="text-step">
70+
<h3>Use Scala 3</h3>
71+
<p>To use the Scala 3 compiler to compile a file <code>test.scala</code> simply run<br><code>scala3-compiler test.scala</code> in your terminal.</p>
72+
<p>The command <code>scala3-repl</code> will start a Scala console that you can use to interactively evaluate Scala programs.</p>
73+
</div>
74+
</div>
75+
</div>
76+
77+
78+
<h2>Installing Scala 3 with <strong>sbt</strong></h2>
79+
<div class="install-steps">
80+
<div class="step arrow">
81+
<img src="/resources/img/download/arrow-asset.png" alt="">
82+
<div class="number-step">1</div>
83+
<div class="text-step">
84+
<h3>First, make sure you have the Java 8 JDK (or Java 11 JDK) installed.</h3>
85+
<p>To check, open the terminal and type:</p>
86+
<p><code>java -version</code><span>(Make sure you have version 1.8 or 11.)</span></p>
87+
<p>The environment variable <code>JAVA_HOME</code> should point to your Java installation.</p>
88+
<p><i>(If you don't have it installed, download Java from <a href="https://www.oracle.com/java/technologies/javase-jdk8-downloads.html">Oracle Java 8</a>, <a href="https://www.oracle.com/java/technologies/javase-jdk11-downloads.html">Oracle Java 11</a>, or <a href="https://adoptopenjdk.net/">AdoptOpenJDK 8/11</a>. Refer <a href="https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html">JDK Compatibility</a> for Scala/Java compatiblity detail.</i></p>
89+
</div>
90+
</div>
91+
<div class="step arrow">
92+
<img src="/resources/img/download/arrow-asset.png" alt="">
93+
<div class="number-step">2</div>
94+
<div class="text-step">
95+
<h3>Install the <i>sbt</i> build tool.</h3>
96+
<p>Visit the <a href="https://www.scala-sbt.org/download.html">sbt website</a> for detailed installation instructions on how to install <i>sbt</i>.</p>
97+
<p><i>(sbt is a build tool that allows you to compile, run, test, and deploy your Scala projects).</i></p>
98+
</div>
99+
</div>
100+
<div class="step">
101+
<div class="number-step">3</div>
102+
<div class="text-step">
103+
<h3>Create a project and use Scala 3</h3>
104+
<p>To create a new Scala 3 project, go to your terminal and run <code>sbt new scala/scala3.g8</code>.</p>
105+
<p>After entering the name of your project (let's say <code>MyProject</code>), in your terminal go to the generated folder (for example <code>myproject</code>) and run the command <code>sbt run</code>.</p>
106+
<p>You should be greeted with a friendly message.</p>
107+
<p><i>(Following conventions for the <a href="https://www.scala-sbt.org/1.x/docs/Directories.html">directory structure</a>, the Scala source files are located under <code>src/main/scala</code>).</i></p>
108+
</div>
109+
</div>
110+
</div>
111+
112+
<div class="install-steps">
113+
<div class="step other-ways-lead">
114+
<div class="number-step"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></div>
115+
<div class="text-step">
116+
<h2>Other ways to install Scala</h2>
117+
<ul>
118+
<li>
119+
Download the Scala binaries for <strong>{{page.release_version}}</strong> at <a href="https://github.com/lampepfl/dotty/releases/tag/{{page.release_version}}">github</a>.
120+
<br/><span class="install"><a href="{{ site.baseurl }}/download/install.html">Need help running the binaries?</a></span>
121+
</li>
122+
<li>On macOS you can also use <a href="https://brew.sh/">Homebrew</a> and runthe following commands<br>
123+
<code>brew update</code><br/><code>brew install lampepfl/brew/dotty</code></li>
124+
<li>Use <a href="https://scastie.scala-lang.org/?target=scala3">Scastie</a> to run single-file Scala programs in your browser using multiple Scala compilers; the production Scala 2.x compilers, Scala.js, Scala 3, and Typelevel Scala. Save and share executable Scala code snippets.</li>
125+
</ul>
126+
<p>Or are you looking for <a href="{{ site.baseurl }}/download/all.html">previous releases</a> of Scala?</p>
127+
</div>
128+
</div>
129+
</div>
130+
131+
<h3>Release Notes</h3>
132+
For a summary of important changes, see the <a href="https://github.com/lampepfl/dotty/releases/tag/{{page.release_version}}">GitHub release notes</a>.
133+
<br/><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release notes</a>.)</small>
134+
135+
<h3>License</h3>
136+
<p>The Scala distribution is released under the {{page.license}}.</p>

_layouts/download.html

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{% include headertop.html %}
2+
{% include headerbottom.html %}
3+
4+
<div class="navigation-fade-screen"></div>
5+
6+
{% include navbar-inner.html %}
7+
8+
<main id="inner-main" class="download-page">
9+
10+
<!-- Title -->
11+
<section class="title-page">
12+
<div class="wrap">
13+
<h1>{{page.title}}</h1>
14+
</div>
15+
</section>
16+
17+
{% comment %}Specific content from child layouts{% endcomment %}
18+
19+
<section class="books">
20+
<div class="wrap">
21+
<div class="inner-box download">
22+
<div class="main-download">
23+
<h2>Which Scala version do you want to use?</h2>
24+
<div class="install-steps">
25+
<div class="step">
26+
<div class="text-step">
27+
<p>You can choose between the battle tested <strong>Scala 2</strong> or the newest <strong>Scala 3</strong>.</p>
28+
</div>
29+
</div>
30+
<div class="download-options">
31+
<div class="download-left">
32+
<span class="or">or</span>
33+
<div class="description">
34+
<img src="/resources/img/download/arrow-left.png" alt="">
35+
<p>Best if you are starting a new code base and want to use the latest version.</p>
36+
</div>
37+
<a href="{{ site.baseurl }}/download/scala3.html" class="btn-download scala3">
38+
<i class="fa fa-download"></i>
39+
<span>Download Scala 3</span>
40+
</a>
41+
<ul>
42+
{% for tutorial in page.scala3tutorials %}
43+
<li><a href="{{tutorial.url}}"><i class="fa fa-file-text-o"></i>{{tutorial.title}}</a></li>
44+
{% endfor %}
45+
</ul>
46+
</div>
47+
<div class="download-right">
48+
<div class="description">
49+
<img src="/resources/img/download/arrow-right.png" alt="">
50+
<p>Best if you are still working with an old code base that is not migrated, yet.</p>
51+
</div>
52+
<a href="{{ site.baseurl }}/download/scala2.html" class="btn-plain-download">
53+
<i class="fa fa-download"></i>
54+
<span>Download Scala 2</span>
55+
</a>
56+
<ul>
57+
{% for tutorial in page.scala2tutorials %}
58+
<li><a href="{{tutorial.url}}"><i class="fa fa-file-text-o"></i>{{tutorial.title}}</a></li>
59+
{% endfor %}
60+
</ul>
61+
</div>
62+
</div>
63+
64+
<h3 class="bottom-lead">What's new in Scala 3?</h3>
65+
<p >
66+
For a summary of important changes in Scala 3, see <a href="https://docs.scala-lang.org/scala3/new-in-scala3.html">this page</a>.
67+
</p>
68+
</div>
69+
70+
</div>
71+
</div>
72+
</div>
73+
</section>
74+
75+
</main>
76+
77+
{% include footer.html %}

0 commit comments

Comments
 (0)