Does the download of Scala IDE 4.0.0 for Eclipse include SBT? - eclipse

The download page at scala-ide.org for the pre-configured Scala IDE for Eclipse (4.0.0 Release) states that its content includes SBT 0.13.6. I downloaded the Mac OS X 64-bit version, and found that the /plugins directory indeed contains a jar file called org.scala-ide.sbt.full.library_0.13.6.v-2... Is this a replacement for having a separate installation of SBT on one's development machine, perhaps facilitating some tighter integration between the Scala Eclipse plugin and SBT? If so, how does it work?

Yes, it does indeed include sbt. It is used internally to control the build, notably the incremental compiler.
It isn't a replacement for having sbt installed on your machine, it isn't really accessible from outside scala-ide.
As for tighter integration, not at the minute.

Related

How to tell which (java) build system eclipse uses?

When working with software projects that employ the Java programming language, there are 3 commonly employed build systems:
Apache ANT-IVY,
Apache Maven,
and Gradle.
Looking through the jungle of the Eclipse Interface each of those build buzzwords occur, yet this IDE gives me no clue what build system it actually uses?
How can I find out what Eclipse thinks should happen when I tell it to build the project?
If you don't set up any special then none of these system is used to build a Java project. The Eclipse Java compiler runs automatically as you type. Other builders written as Eclipse plugins run when resources change, you can see information about these in the 'Builders' page of the project Properties.
There are Eclipse plugins that add support for all the build systems you mention. They are used if you create a project specifying which system you want to use.

Installing a scala "ecosystem" on Linux (debian)?

Newbie to scala.
Reading some descriptions of how to install a scala ecosystem has me confused. I will be installing on a apt-based linux system. My choice of editor/ide will be emacs ( though I might play with Eclipse and IntelliJ ).
Not a java programmer. I also like to do projects as different users for different purposes.
From what I understand the steps are:
Install sbt from the linux distro repo as root.
Install the newest sbt from the installed sbt as root.
Install the newest scala from sbt as root.
Install ensime from sbt as root.
( or do I install it from melpa? )
Also I heard of something called Scala Worksheet which might be useful. The version I heard of is a Eclipse plusin. Is there a version that can be used with emacs?
You can install ensime as normal user from MELPA without problems. Just read carefully the instructions in their web page. It is important to install the ensime SBT plugin in the user directory instead of the project plugin directory.
The ensime integration works way better that Eclipse's Scala IDE.
About the worskheet, it would be nice to have it in emacs but it is not really needed . You can work quite fine just with sbt.

Eclipse MapReduce plugin Hadoop 2.5.2

I know this question has been asked many times before, but I couldn't find any for this specific case, and this up-to-date. How do I install the Eclipse MapReduce plugin with Hadoop 2.5.2? I've found multiple tutorials addressing this for other versions, and I know that it can be compiled from here, but that link, while it says 2.x, only says up to 2.4.1. I tried to compile it anyway using 2.5.2 using the following command:
ant jar -Dversion=2.4.1 -Dhadoop.version=2.5.2 -Declipse.home=/opt/eclipse -Dhadoop.home=/usr/local/hadoop -DBuildfile: build.xml
This attempted to compile, but then returned
Warning: Could not find file /usr/local/hadoop/share/hadoop/common/lib/jackson-core-asl-1.8.8.jar to copy.
Which makes sense, because the version of this jar in Hadoop 2.5.2 is 1.9.13.
Then I tried to use version 2.5.2, even though it is not mentioned in the jar, since it says that they support 2.x.
ant jar -Dversion=2.5.2 -Dhadoop.version=2.5.2 -Declipse.home=/opt/eclipse -Dhadoop.home=/usr/local/hadoop -DBuildfile: build.xml
In this case, it said BUILD SUCCESSFUL, but there was no output - no jar produced, and no output printed under the 'compile:' and 'jar:' steps.
I even tried downloading the compiled jar from this guy's github, but of course that didn't work either - it didn't show up in Eclipse when I added the jar to the plugins folder.
Is there any way to use the plugin with Hadoop 2.5.2, or do I have to downgrade to 2.4.1? I am using Ubuntu 14.0.4, Hadoop 2.5.2, and Eclipse Luna, but can downgrade that if necessary.
I downloaded hadoop-eclipse-plugin-2.6.0.jar (at the time of writing this is the latest) from https://github.com/winghc/hadoop2x-eclipse-plugin/tree/master/release and pasted the jar file in the plugin folder of the Eclipse. It gave me "Map/Reduce" Wizard and I got the "Run on Hadoop" Option!! I am using Eclipse Luna.
you could use the "Hadoop" Wizard to define the HDFS Server.
If you just need to run the map-reduce jobs from eclipse, then you need to
Create a Java project in eclipse
Add the hadoop jar files in the project reference library
Mapreduce programs can be compiled and executed from eclipse.
Note: By default eclipse considers the local filesystem for input and output files.

How to build JGit in Eclipse (dependency errors)

I'm trying to build the latest version of JGit. I checked out the latest version from the Git repository. According to the build instructions, I installed the dependencies via Orbit. I then ran mvn clean install which was able to compile everything and run all the tests. So this was great, there were no errors, and I can find the compiled .jar files.
I then opened Eclipse and imported the projects into a working set. For some reason, there are numerous errors in the build process.
Imports cannot be resolved:
import org.apache.commons.compress.archivers.ArchiveOutputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.archivers.tar.TarConstants;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
And more cannot be resolved:
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
I tried installing Jetty via Eclipse (Install New Software). However, that did not resolved the issue.
Am I just not supposed to build JGit in Eclipse? All builds and testing should be done with Maven? I'm also confused as to why Jetty and Apache are being imported in some of these subprojects for JGit and they're not listed as dependencies of JGit on the wiki.
Thanks in advance.
The easiest way to install the dependencies is to use one of the target platforms, as described in Use a Target Platform. It includes all dependencies.
As for installing from the Orbit P2 repository, the listing there was incomplete. You also need to install "Apache Commons Compress", see updated instructions:
http://wiki.eclipse.org/EGit/Contributor_Guide#Option_2:_Install_from_Orbit_P2_Repository
Jetty can not be installed from Orbit, see here for instructions:
http://wiki.eclipse.org/EGit/Contributor_Guide#JGit_HTTP_Tests
Or again, use the target platform where Jetty is also included.
The Jetty and Compress libraries are used by part of the JGit infra, but the EGit support in Eclipse doesn't need everything that JGit has.
For example, JGit also provides a collection of command-line programs (jgit init, jgit add etc.) which are not used in Eclipse. So you need to build the 'pgm' module from MAven, but that in itself isn't used by EGit which is the UI in Eclipse. Similarly, the JGit HTTP server is useful but not required for EGit operation.
I believe the archivers are used to extract out tools via the pgm module for 'jgit archive', which extracts out the contents of a branch and generates a Zip or TGZ file on the fly.
If you don't want (or need) the pgm module (and i'd suggest possibly also avoiding the iplog as well) then you can uncomment those from the list of modules in the pom.xml file. Removing the http.server (and http.test) along with the pgm modules will probably allow you to compile without needing the Jetty and Apache compress modules.

How to use just one scala library for maven/eclipse/scala

I have configured a project to use scala/maven/Eclipse. Because I need a scala library on the build path and scalatest also uses its own scala library I receive this warning :
More than one scala library found in the build path, all with
compatible versions. This is not an optimal configuration, try to
limit to one scala library in the build path.
I don't think I can remove this warning as I need both libraries - one for Maven, the other for Eclipse. This doesn't seem to be causing any problems so will I just have to accept it? Is there an alternate configuration which uses just one scala library for Maven & Eclipse?
If I remove the scala library from the project I receive the error:
Cannot find Scala library on the classpath. Verify your build path!
For some reason Eclipse requires the scala library to be on the build path even though it is already available as a Maven dependency.
There is nothing to worry about. Eclipse warns you that you have several scala-library.jars on your classpath, but as long as they are the same version, it doesn't matter.
If one of them diverged (for instance, by bumping the Scala version number in your pom file), you'd be in trouble: depending on the classpath order, the IDE will pick up classes from one or the other, and you might get different results when building on the command line.
Coming back to your setup, you could
remove the Scala Library classpath container from your Eclipse projects, leaving just the jar that maven adds.
ignore the warning
Venturing a guess here, are you using the Eclipse Indigo pre-installed with Scala 2.9 and the corresponding Scala plugin? If that's the reason you need to use that library, perhaps consider using Eclipse Juno? That's what I use and it works quite well with both the milestone and the nightly builds