Skip to content

Converge on one get-started instructions, recommend on landing page #1344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 22 additions & 59 deletions _includes/downloads-scala2.html
Original file line number Diff line number Diff line change
@@ -1,70 +1,38 @@
<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>
<div class="install-steps">
<h3>Release Notes</h3>
For a summary of important changes, see the <a href="https://github.com/scala/scala/releases">GitHub release notes</a>.
<br /><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release
notes</a>.)</small>

<div class="step arrow">
<img src="/resources/img/download/arrow-asset.png" alt="">
<div class="number-step">1</div>
<div class="text-step">
<h3>First, make sure you have the Java 8 JDK (or Java 11 JDK) installed.</h3>
<p>To check, open the terminal and type:</p>
<p><code>java -version</code><span>(Make sure you have version 1.8 or 11.)</span></p>
<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>
</div>
</div>
<div class="step">
<div class="number-step">2</div>
<div class="number-step"><i class="fa fa-check" aria-hidden="true"></i></div>
<div class="text-step">
<h3>Then, install Scala:</h3>
<p>...either by installing an IDE such as IntelliJ, or sbt, Scala's build tool.</p>
</div>
</div>
<div class="download-options">
<div class="download-left">
<span class="or">or</span>
<div class="description">
<img src="/resources/img/download/arrow-left.png" alt="">
<p>Best if you prefer a full-featured IDE (recommended for beginners)</p>
<h2>Recommended Download</h2>
<div class="download-options">
<a href="https://docs.scala-lang.org/getting-started/index.html" class="btn-download" id="get-started-link">
<i class="fa fa-download"></i>
<span>Get Started With Scala</span>
</a>
</div>
<a href="https://www.jetbrains.com/idea" class="btn-download" id="download-intellij-link">
<i class="fa fa-download"></i>
<span>Download intellij</span>
</a>
<ul>
{% include tutorial-list.html column=1 %}
</ul>
</div>
<div class="download-right">
<div class="description">
<img src="/resources/img/download/arrow-right.png" alt="">
<p>Best if you are familiar with the command line</p>
</div>
<a href="https://www.scala-sbt.org/download.html" class="btn-download" id="download-sbt-link">
<i class="fa fa-download"></i>
<span>Download Sbt</span>
</a>
<ul>
{% include tutorial-list.html column=0 %}
</ul>
</div>
</div>

<p class="bottom-lead">
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.
<br><br>
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!
<br><br>
</p>

<!-- <p class="bottom-lead"><h2>Other</h2></p> -->

<div class="step other-ways-lead">
<div class="number-step"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></div>
<div class="text-step">
<h2>Other ways to install Scala</h2>
<h2>Other ways to download Scala</h2>
<ul>
<li>
Using <a
href="https://docs.scala-lang.org/getting-started/index.html#using-the-scala-installer-recommended-way">Coursier
CLI</a>, run:<br>
<code>cs install scala:{{ page.release_version }} && cs install scalac:{{ page.release_version }}</code>.
</li>
<li>
<a id="download-binaries">Download the Scala binaries for <span id="users-os"></span></a>
<br/><span class="install"><a href="{{ site.baseurl }}/download/install.html">Need help running the binaries?</a></span>
</li>
<li><a href="/documentation/getting-started-intellij-track/getting-started-with-scala-in-intellij.html">Download and use Scala</a><span> with </span><a href="https://www.jetbrains.com/idea">IntelliJ</a><span> and then </span><a href="/documentation/getting-started-intellij-track/building-a-scala-project-with-intellij-and-sbt.html">build a project</a><span>, then </span><a href="/documentation/getting-started-intellij-track/testing-scala-in-intellij-with-scalatest.html">test it.</a></li>
<li>Using <a href="https://sdkman.io/">SDKMAN!</a>, you can easily <a href="https://sdkman.io/sdks#scala">install specific versions of Scala</a> on any platform with <code>sdk install scala {{ site.scalaversion }}</code></li>
<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>
<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>
Expand All @@ -76,12 +44,7 @@ <h2>Other ways to install Scala</h2>
</div>
</div>


<h3>Release Notes</h3>
For a summary of important changes, see the <a href="https://github.com/scala/scala/releases">GitHub release notes</a>.
<br/><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release notes</a>.)</small>

{% include download-resource-list.html %}
<h3>License</h3>
<p>The Scala distribution is released under the {{page.license}}.</p>
</div>
<h3>License</h3>
<p>The Scala distribution is released under the {{page.license}}.</p>
128 changes: 18 additions & 110 deletions _includes/downloads-scala3.html
Original file line number Diff line number Diff line change
@@ -1,121 +1,34 @@
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>.

<h2>Getting Started with Scala 3</h2>
<div class="install-steps">
<p>
Depending on your experience and your requirements, there exist two ways to
install Scala 3 on your computer,
either through <a href="https://www.scala-sbt.org/download.html">sbt</a>, or
through <a href="https://get-coursier.io/docs/cli-installation">Coursier</a>.
</p>

<div class="download-options">
<div class="download-left">
<span class="or">or</span>
<a href="https://get-coursier.io/docs/cli-installation" class="btn-download">
<i class="fa fa-download"></i>
<span>Download Coursier</span>
</a>
<div class="text-variant">
<p>Best if you want to get <strong>started quickly</strong>.</p>
<p><i>Coursier will install all the necessary dependencies for you, so after
installing Coursier you are ready to go.</i></p>
</div>
</div>
<div class="download-right">
<a href="https://www.scala-sbt.org/download.html" class="btn-download">
<i class="fa fa-download"></i>
<span>Download Sbt</span>
</a>
<div class="text-variant">
<p>Best if you want to work on <strong>larger projects</strong>.</p>
<p><i>If you already have sbt installed, it is very easy to switch to Scala version {{page.release_version}}.</i></p>
</div>
</div>
</div>
</div>

<h2>Installing Scala 3 with <strong>Coursier</strong></h2>
<div class="install-steps">
<div class="step arrow">
<img src="/resources/img/download/arrow-asset.png" alt="">
<div class="number-step">1</div>
<div class="text-step">
<h3>Install the <i>Coursier</i> Scala artifact fetcher.</h3>
<p>Visit the <a href="https://get-coursier.io/">Coursier website</a> for detailed installation instructions on how to install Coursier.</p>
<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>
</div>
</div>
<!-- <div class="step">
<div class="number-step">2</div>
<div class="text-step">
<h3>Then, prepare your environment</h3>
<p>Open a terminal and run the following command: <code>cs setup</code></p>
<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>
</div>
</div> -->
<div class="step arrow">
<img src="/resources/img/download/arrow-asset.png" alt="">
<div class="number-step">2</div>
<div class="text-step">
<h3>Then, install Scala 3</h3>
<p>Open a terminal and run the following commands:</p>
<p><code>cs install scala3-compiler</code><span>to install the Scala 3 compiler.</span></p>
<p><code>cs install scala3</code><span>to install the Scala 3 code runner</span></p>
</div>
</div>
<div class="step">
<div class="number-step">3</div>
<div class="text-step">
<h3>Use Scala 3</h3>
<p>The command <code>scala3</code> will start the Scala console, it is an interactive read-eval-print-loop that you can use to directly enter and run Scala expressions.</p>
<p>To use the Scala 3 compiler to compile a file <code>test.scala</code>, run<code>scala3-compiler test.scala</code> in your terminal.</p>
<p>The command <code>scala3 hello Scala</code> will run the main method of a class called <code>hello</code>, passing the argument <code>"Scala"</code>.</p>
</div>
</div>
</div>

<h3>Release Notes</h3>
For a summary of important changes, see the <a
href="https://github.com/lampepfl/dotty/releases/tag/{{page.release_version}}">GitHub release notes</a>.
<br /><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release
notes</a>.)</small>

<h2>Installing Scala 3 with <strong>sbt</strong></h2>
<div class="install-steps">
<div class="step arrow">
<img src="/resources/img/download/arrow-asset.png" alt="">
<div class="number-step">1</div>
<div class="text-step">
<h3>First, make sure you have the Java 8 JDK (or Java 11 JDK) installed.</h3>
<p>To check, open the terminal and type:</p>
<p><code>java -version</code><span>(Make sure you have version 1.8 or 11.)</span></p>
<p>The environment variable <code>JAVA_HOME</code> should point to your Java installation.</p>
<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>
</div>
</div>
<div class="step arrow">
<img src="/resources/img/download/arrow-asset.png" alt="">
<div class="number-step">2</div>
<div class="number-step"><i class="fa fa-check" aria-hidden="true"></i></div>
<div class="text-step">
<h3>Install the <i>sbt</i> build tool.</h3>
<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>
<p><i>(sbt is a build tool that allows you to compile, run, test, and deploy your Scala projects).</i></p>
<h2>Recommended Download</h2>
<div class="download-options">
<a href="https://docs.scala-lang.org/getting-started/index.html" class="btn-download" id="get-started-link">
<i class="fa fa-download"></i>
<span>Get Started With Scala</span>
</a>
</div>
</div>
</div>
<div class="step">
<div class="number-step">3</div>
<div class="text-step">
<h3>Create a project and use Scala 3</h3>
<p>To create a new Scala 3 project, go to your terminal and run <code>sbt new scala/scala3.g8</code>.</p>
<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>
<p>You should be greeted with a friendly message.</p>
<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>
</div>
</div>
</div>

<div class="install-steps">
<div class="step other-ways-lead">
<div class="number-step"><i class="fa fa-ellipsis-h" aria-hidden="true"></i></div>
<div class="text-step">
<h2>Other ways to install Scala</h2>
<h2>Other ways to download Scala</h2>
<ul>
<li>
Using <a href="https://docs.scala-lang.org/getting-started/index.html#using-the-scala-installer-recommended-way">Coursier CLI</a>, run:<br>
<code>cs install scala:{{page.release_version}} && cs install scalac:{{page.release_version}}</code>.
</li>
<li>
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>.
<br/><span class="install"><a href="{{ site.baseurl }}/download/install.html">Need help running the binaries?</a></span>
Expand All @@ -131,10 +44,5 @@ <h2>Other ways to install Scala</h2>
</div>
</div>
</div>

<h3>Release Notes</h3>
For a summary of important changes, see the <a href="https://github.com/lampepfl/dotty/releases/tag/{{page.release_version}}">GitHub release notes</a>.
<br/><small>(Or consult our archive of <a href="{{ site.baseurl }}/blog/announcements/">older release notes</a>.)</small>

<h3>License</h3>
<p>The Scala distribution is released under the {{page.license}}.</p>
23 changes: 9 additions & 14 deletions _layouts/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,36 @@ <h1>{{page.title}}</h1>
<div class="wrap">
<div class="inner-box download">
<div class="main-download">
<h2>Which Scala version do you want to use?</h2>
<h2>Download or Upgrade Scala</h2>
<div class="install-steps">
<div class="step">
<div class="text-step">
<p>You can choose between the battle tested <strong>Scala 2</strong> or the newest <strong>Scala 3</strong>.</p>
</div>
</div>
<div class="download-options">
<div class="download-left">
<span class="or">or</span>
<div class="description">
<img src="/resources/img/download/arrow-left.png" alt="">
<p>Best if you are starting a new code base and want to use the latest version.</p>
<p>Recommended method for all Scala users.</p>
</div>
<a href="{{ site.baseurl }}/download/scala3.html" class="btn-download scala3">
<a href="https://docs.scala-lang.org/getting-started.html" class="btn-download scala3">
<i class="fa fa-download"></i>
<span>Download Scala 3</span>
<span>Get Started with Scala</span>
</a>
<ul>
{% for tutorial in page.scala3tutorials %}
{% for tutorial in page.newcomertutorials %}
<li><a href="{{tutorial.url}}"><i class="fa fa-file-text-o"></i>{{tutorial.title}}</a></li>
{% endfor %}
</ul>
</div>
<div class="download-right">
<div class="description">
<img src="/resources/img/download/arrow-right.png" alt="">
<p>Best if you are still working with an old code base that is not migrated, yet.</p>
<p>Best if you have an advanced use case.</p>
</div>
<a href="{{ site.baseurl }}/download/scala2.html" class="btn-plain-download">
<a href="{{ site.baseurl }}/download/all.html" class="btn-plain-download">
<i class="fa fa-download"></i>
<span>Download Scala 2</span>
<span>Pick a Specific Release</span>
</a>
<ul>
{% for tutorial in page.scala2tutorials %}
{% for tutorial in page.advancedtutorials %}
<li><a href="{{tutorial.url}}"><i class="fa fa-file-text-o"></i>{{tutorial.title}}</a></li>
{% endfor %}
</ul>
Expand Down
5 changes: 2 additions & 3 deletions _layouts/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>{{page.headerTitle}}</h1>
<div class="scala-main-resources">
<div class="wrap">
<div class="resources">
<div class="download">
<div class="get-started">
<a href="{{page.gettingStarted.mainUrl}}" class="button">{{page.gettingStarted.mainTitle | upcase}}</a>
<ul>
<li><a href="{{page.gettingStarted.subtitleLink}}">{{page.gettingStarted.subtitle}}</a></li>
Expand All @@ -61,7 +61,7 @@ <h1>{{page.headerTitle}}</h1>
{% endfor %}
</ul>
</div>
<div class="api-docs">
<div class="learn-scala">
<a href="{{page.apiDocs.mainUrl}}" class="button">{{page.apiDocs.mainTitle | upcase}}</a>
<ul>
<li><a href="{{page.apiDocs.subtitleLink}}">{{page.apiDocs.subtitle}}</a></li>
Expand All @@ -74,7 +74,6 @@ <h1>{{page.headerTitle}}</h1>
<div class="circle-solid">
<img src="/resources/img/frontpage/scala-spiral.png" alt="">
<div class="scala-version">
<span>Scala</span>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions _sass/layout/download.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
}

.btn-plain-download {
background: $gray-lighter;
display: block;
text-align: center;
text-transform: uppercase;
Expand Down
Loading