Installing JDK on OSX Lion for Scala - scala

I just signed up for the Coursera class on Scala and one of the requirements is Java Virtual Machine JDK 1.6 or higher.
I'm actually a PHP/Py/Ruby developer and haven't touched Java in 10 years.
What do I actually need to install on my Mac (10.7.5 Lion)?
javac -version gives me 1.6.0_15
is this all I need other than the Scala install, or do I need to download specific developer tools? I plan on developing Scala with SublimeText2, there's an sbt plugin for it now.

Scala is a popular enough of a language for there to be plenty of information on how to get started from scratch. For example, googling for "scala installation" gave me (amongst other stuff) http://www.tutorialspoint.com/scala/scala_environment_setup.htm —they talk about JVM versions, how to install Scala, etc; i.e. all you need. If that page won't do, I'm sure you'll find many more.

If you are doing the coursera course, you can check out the first chapter, it explains how to install scala with a comprehensive step-by-step video.
It is in the first chapter Getting started --> Tools setup for Mac OS X.
If your course hasn't started yet, you can look up it in the archive (previous sessions of the course).
Otherwise, one way to install Scala is :
Download Scala on http://scala-lang.org/download/
Extract it in your favorite folder, let's call it ~/installations/scala-X.Y.Z
Open the file ~/.bashrc (~/.zshrc if you are using zsh...)
Write :
export SCALA_HOME=~/installations/scala-X.Y.Z/
export PATH=$PATH:$SCALA_HOME/bin
Type in your terminal : source ~/.bashrc
There you go, you can now access scala by typing scala in your terminal

Related

configuring the interpreter for eclipse 4.6.0

I am trying to start a new PyDev Project and first need to setup the interpreter. The auto-config does not find a "valid interpreter". And so I must manual config. Perhaps someone with experience in this procedure knows of the specific name for the Interpreter Executable I am looking for. Thanks!
To get the interpreter you need to use, start the python interactive console in a shell and then do:
import sys; print(sys.executable)
The path printed is the interpreter you should use.
As a note, PyDev 4.6.0 is pretty old already, so, my suggestion would be upgrading to the latest release as many things were improved in the meanwhile.

Finding and using clojure.contrib.string

I have CounterClockwise for Eclipse and believe clojure.contrib should be installed. However, I can't seem to use it or any of the subfiles such as clojure.contrib.string. If I type as I get the following errors
If I type (require 'clojure-contrib.string) I get:
FileNotFoundException Could not locate clojure_contrib/string__init.class or clojure_contrib/string.clj on classpath: clojure.lang.RT.load (RT.java:443)
Long ago in an internet far far away Clojure had a large utility library called clojure.contrib which turned out to be rather hard to maintain, so it was broken up into many libraries, each of which uses the Clojure contributors agreement. In this process clojure.contrib.string became just clojure.string and the names of all the other projects changed and they are released independently now. Seeing references to clojure.contrib is a sign that you are looking at outdated documentation. Also watch out for tutorials that make references to installing Clojure or installing dependencies without leiningen.

How do you set up an x64 development environment based on gcc and eclipse?

I want to create 64 bit apps for (for example) 64 bit Windows 7. I've searched the web and found some help but couldn't get it to work.
Sorry I've taken so long to respond but I have tried to get the packages suggested to work but they're not easy or else I'm doing something wrong.
Anyway I ran across an environment called pellesc. It consists of a development environment around a compiler which traces is roots back to a 32-bit version that was once (according to Wikipedia) used to develop Quake. From what I've seen so far it's very promising and generates good code too!
In spite of what other people are saying, Eclipse actually has very good support for C++, even in Windows: check out the CDT project. It's very mature and well-supported -- it works for C/C++ at least as well as Eclipse JDT works for Java.
As for the compiler itself, VonC is right, MinGW-w64 (but the mingw-w64 project is moving to mingw-w64.org so i suggest to use mingw-w64.org) is the best option. Eclipse CDT has built-in support for MinGW so as long as you install MinGW first, Eclipse should automatically detect it.
This Eclipse MinGW64 tutorial mentions:
update (Nov 9, 2010): recent MinGW-w64 versions come with 'as', 'g++', and 'gcc' commands. This step may be unnecessary in your MinGW build.
Meaning you won't have anymore to update the GCC assembler, C++ compiler, C compiler and C++ linker, with 'x86_64-w64-mingw32-as', 'x86_64-w64-mingw32-g++', 'x86_64-w64-mingw32-gcc', and 'x86_64-w64-mingw32-g++'.
Other great source for w64 development tools:
Native windows x64 software develop with Mingw-w64 on drangon.org
A 64-bit version of GCC for Windows is available at http://tdm-gcc.tdragon.net/download. I can't see why you would want to use Eclipse for C or C++ programming - try the Code::Blocks IDE at http://www.codeblocks.org instead.
Honestly, I use cygwin. Its compatable with unix so you can easily move systems and has tons of functionality that is gcc friendly (autoconf, make, makedepends, ...). To use gcc to compile to 64 bit add the -m64 option. To compile for windows use the -mno-cygwin option. Make sure though that you're using gcc 3 and not 4 (then you'd use the mingw compiler series). Otherwise, its all the same as unix which is really useful.

What are the exact versions of stuff you have to install in order to be able to step-debug a Scala program?

How do YOU debug a Scala program?
I mean YOU as in the person posting the Answer :) Please answer only from personal experience, not from stuff you've heard or read on the Internet. You should not believe everything you read on the Internet, especially tales of complex open-source software configurations that actually work :-)
The are many Java tools which claim to support Scala in some way or another, but I have so far struck out in trying to get any one of them to actually let me set a breakpoint in Scala code and step through it. These are big, major open-source IDEs I'm talking about here.
The main problem in getting a debugger to work seems to be the "version hell" with fast-changing IDEs, Plug-Ins, JDKs, and the Scala language itself.
Hence, the more detailed re-statement of the question is appropriate: What is the exact version number of the IDE, Plug-In, JDK, Scala, and even Operating System, that you are successfully using?
My question is related to this one, but wider in scope:
How To: debug Scala code when outside of an IDE
Thanks
In our development we use IntelliJ IDEA 9.0.1 which is available by the link below:
http://www.jetbrains.com/idea/download/
with Scala plugin installed:
http://confluence.jetbrains.net/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin
All you need is to have project with Scala sources (probably, mixed with Java or other JVM-based languages) opened. You can compile it and run as Java application, maven goal etc. or connect to the remote application if it has been run in debug mode.
See IntelliJ help for details of adjusting debug configuration.
Cheers!
Ilya
I've worked with Eclipse and the Scala plugin for it. It works somewhat ok, if you can overlook the fact that it doesn't remember the configuration for your Scala application on the next run.
I debug my Scala programs by running relevant parts of it on the REPL, as to verify what it is really doing. Other than that, the good old println or logs.
Digressing here a bit, it has been a rare thing in my life a situation where step-in debuggers were actually required -- and, then, mostly for assembler code, though languages where testing snippets of code is difficult for some reason were more likely to require it than others which weren't.
OS: xUbuntu(GNU/Linux) 9.10
JDK:
java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
(which is the Java-6-sun-version, used by the xUbuntu-installer).
Eclipse: 3.5.1 Build id: 20090920-1017
Scala-Plugin 2.7.7final
Scala 2.7.7
If possible: println-Statements, because eclipse is often tricky to invoke (does not find the main class, even after complete rebuild, closing/opening project, deleting old class-Files). The latest search for a problem ended when I 'deleted all bookmarks' - suddenly I was allowed to run the program.
Curious observation: class Bruch was what I tried to run, but eclipse allways mentioned 'Bruc' and named the runtime-configuration like this. Adding and removing characters reflected in the generated name accordingly (Bruc => Bru).

Launching an arbitrary executable over a file on Netbeans

We want to add command-line support to Netbeans, as in being able to run any program (using the full path of the current file as the argument) directly from the IDE. The same way you can do it already on Notepad++ with the Run tool.
Apparently there is a plugin called VCS Generic Command-Line Support that offers this functionality, but when we try to install it we get this error message:
Some plugins require Master Filesystem to be installed
The plugin Master Filesystem is
requested in version >= 1.1 but only
2.15.2 was found.
Any ideas?
EDIT
I Did some googling as you got me interested pretty much everything i found was in refernce to NetBeans 5.x or below... Im thinking maybe its not compatible with 6 - but thats just a guess.
Looks like a version incompatability with "Master Filesystem". Maybe they are checking the version improperly or perhaps they really mean it needs to be 1.x >= 1.1. Do you have the newest version of VCS Plugin?
As an aside if Im going to have to chek this out... ive been dying for external tool support like in my beloved Eclipse :-)