Should I install Scala separately for command line and Eclipse IDE? - scala

I've installed Scala IDE for Eclipse using the update mechanism, and then I found that there's no command line tools included there. So is it correct that I should download another copy of Scala package for the command line support and maintain both separately?
Or is there an integrated way to get it work in both environments? I just want to write and debug code in Eclipse and occasionally run it on the command line.

First, you can open a Scala command-line within Eclipse. Just go to Window -> Show View -> Scala Interpreter, and it will open an interpreter window that has your project loaded into the classpath.
Second, there's nothing wrong with having a separate Scala installation for command-line use. I do this. It's often convenient to have a few terminal windows where you can run stuff or quickly test bits of code.

You need to install the scala compiler first. Otherwise you can not use the eclipse plugin. If you have installed the scala compiler, you just need to add it to your classpath. Now you can type scala into any terminal you are using and the REPL starts.

Related

When I run engine.scala nothing happens

I'm using gatling and scala ans eclipse as an editor, when I click on Engine.scala to run it nothing happen, I dont know why ?
ScalaIDE (the Eclipse plugin for Scala) seems to be dead. You should either run from the command line with maven (mvn gatling:test) or switch to IntelliJ (that has great built-in support for Scala).

How to use existing Scala with Intellij

I already have brew install scala - I am able to run Scala via command line. After that I installed IntelliJ version 2016.1.3
While installation process of IntelliJ, I was asked to install Scala plugin but i clicked no - because I already have Scala installed
Now I am trying to figure out where exactly we can create a Scala application with the use of my existing Scala installed. How and where in the IntelliJ can I set this up? I can only see Java projects available to be created.
Thanks
You can't. The Scala you have installed is a completely different thing from the IDEA Scala plugin.
The Scala plugin is what you need to handle Scala projects, editing Scala files, etc. in IDEA. The command-line Scala is just the compiler and the standard library, it doesn't know anything about IDEA.
Also, for the command line you should install SBT instead of working directly with the Scala compiler unless you want to handle dependencies, classpaths, etc. manually (you don't).
If you want to create Scala application using IntelliJ IDEA, you will need to install the Scala Plugin.
Step 1: Open IntelliJ Preferences or Settings
On Mac:
Open IntelliJ IDEA.
Then click on the menu item IntelliJ IDEA and select Preferences.
On Windows:
Open IntelliJ IDEA.
On the bottom right corner of the Welcome to IntelliJ screen, select Configure.
Step 2: Find and install Scala Plugin
After opening the Preferences or Settings screen from Step 1, click on the Plugins section on the left panel.
Then click on the Install JetBrains plugin… button.
This opens another window which has a Search box on the top left corner. Type in Scala in the search box and this will list the Scala plugin which you need to install.
Hit the Install button to kick off the installation.
Do not forget to Restart IntelliJ following the install.
And Voila! You should now be able to create Scala projects in IntelliJ.
For further instructions on how to install Scala plugin in IntelliJ, you can follow the instructions from www.allaboutscala.com

Show build output when running a Java project in NetBeans

I created a small Java project in NetBeans. When I run it, there appears no compiler log.
I'd like to see the compiler output even when I decide to run the project. How can I enable it?
In NetBeans Menu/Window/Output

Intellij IDEA. Several SBT consoles

How I can run several SBT consoles in Intellij IDEA 12? I need it because I want to run 3 project modules, but when I run first it blocks SBT console until I kill process. I can achieve same result using 3 command line windows (cmd) but I want to run all from IDE.
P.S. I have installed sbt plugin.
You could open multiple terminal windows in the IDE and use SBT (see highlighted area):

Access the Eclipse Scala compiler from the terminal

I'm just starting out with Scala (trying to setup Eclipse, Lift and SBT on Mac Lion) and I'm not sure if I need the scala compiler through homebrew or can I just use the built in Eclipse Scala compiler through Eclipse and (if I also need to) through the Terminal.
If that's a good idea, how do I run it through the terminal ?
You won't be able to access the Eclipse-IDE scala compiler through terminal, so if you want terminal access, you should install a standalone scala interpreter separately.
While you don't technically need terminal access since Eclipse will compile everything for you and you can run the interpreter through Eclipse (Window -> Show View -> Scala Interpreter), I like to have the option, so I always have a separate installation of the same version of the compiler that Eclipse uses.
Instead if installing scala, I normally have a blank sbt project, and start the scala REPL by doing
sbt console
This allows me to easily change scala versions and if I add dependencies to the project, they will be added to the console classpath.