Scala Plugin for NetBeans - Rewrite in Scala #1: Almost Done

The previous Scala plugin for NetBeans was a rush work which was written in Java, toward a useful tool to support writing Scala code. I called it chicken, which was then can be used to produce new Scala plugin written in Scala, that was, the egg.

The egg has grown to a chicken now. As for last night, I switched whole scala modules to depend on the new written scala.editor module (in Scala), and use this new chicken to improve Scala plugin from now on.

The new scala plugin will be carefully rewritten, with a lot of APIs supporting for language editor in mind, and try to support better and more features toward a whole featured, stable Scala IDE.

Another good news is, Milos Kleint, the contributor to NetBeans Maven plugin, has also put hands on this project, he's working on better Scala support for maven project, and new templates/hinds features for Scala editor modules.

The new plugin is based on Scala 2.8 snapshot, if want to get it, you should use the nightly built NetBeans from, and get the new plugins via updated center.

Note: you have to install the latest Scala 2.8 snapshot too, and make sure $SCALA_HOME, $PATH pointed to it. For maven project, you should also update your pom.xml to depend on Scala -2.8-snapshot.

Below is a working snapshot that I was using new Scala plugin to write Scala plugin:


  • Posted: 2009-08-07 09:00 (Updated: 2009-12-30 03:40)
  • Author: dcaoyuan
  • Categories: NetBeans


1. Stefan -- 2009-08-07 09:00

Awesome! This is a great proof of what can be done in Scala...

2. Caoyuan -- 2009-08-07 09:00

@Stefan, yes. Scala also provides so many good features for API writing. I found, sometimes, member types can save me a lot from type parameters, of course, both are important.

3. JustMe -- 2009-08-08 09:00

Is it supposed to work in NB 6.7.1? If not, any plans to support it later? Thanks.

4. Caoyuan -- 2009-08-08 09:00

@JuetMe?, NB 6.7.1 itself has some performance issues, so we'd better wait for 6.8 M2+

5. Michael -- 2009-08-08 09:00


Lovely. I pulled down the source recently, but NetBeans refuses to open the project: it says "project requires at least nb-build". I found at NetBeans wiki what nb-build is, but still cannot figure out how to hook it in.

Detail build instructions are long overdue in my opinion, since your plugin is the best real world example of a NetBeans plugin in Scala.

Thank you.

6. Caoyuan -- 2009-08-08 09:00

@Michael, the steps to build scala plugin from source:

======== mkdir nbsrc cd nbsrc hg clone

cd main

# make sure you are under nbsrc.main, then build netbeans: ant clean build

cd contrib/scala.kit ant scala-clean scala-nbm

========== Now, the scala nbms can be found under: contrib/scala.kit/build

7. Jeff Johnston -- 2009-08-08 09:00

I recently wrote up a tutorial on the wiki on how to get Netbeans running in the IDE. See if this works for you!

8. Steve Lianoglou -- 2009-08-08 09:00

This is great stuff. Just wanted to let you know that your work is much appreciated.


9. Andrew -- 2009-08-08 09:00

'hg clone' doesn't check out contrib. As well as provided hrefs don't say how to do it. Please, fill in this gap.


10. Caoyuan -- 2009-08-09 09:00

@Andrew, typo, should do

hg clone

after clone main

11. Caoyuan -- 2009-08-09 09:00

I added steps for building scala plugin from source at:

12. Andrew -- 2009-08-10 09:00


Thanks! - have built both NB and the plugin.

BTW, do I understand well the plugin rewriting is along with recent Martin's (and Miles) work in Scala internals to make the compiler more friendly for any IDE-related design?

13. Caoyuan -- 2009-08-10 09:00

@Andrew, I'm following Martin's work of the better compiler, but has not got much deep yet.

14. boris -- 2009-08-12 09:00

I installed the latest Scala snapshot (2.8), updated SCALA_HOME and PATH accordingly, installed the Netbeans nightly build and the scala plugin ... but when I open the scala console inside netbeans I get the 2.7.3 version ...?

Thank you

15. Caoyuan -- 2009-08-12 09:00

@boris, which version it shows when you run 'scala' directly in a command window?

16. Steve Thompson -- 2009-08-13 09:00

I'm seeing the same thing as Boris. The first time that I built NetBeans and the Scala plug-in a few days ago, the NetBeans environment was correctly running with 2.8. Now though the Scala Platform is reported as 2.7.3 and shows the path to the lib as:


From the command line however, the scala version is 2.8, because SCALA_HOME and my PATH are both set correctly.

17. Andrew -- 2009-08-13 09:00

Another strange thing: just after starting newly upgraded (from repo) and built NB and installing nbms, NB's plugin manager suggests two Scala-related updates.

18. Caoyuan -- 2009-08-14 09:00

It seems I need to rethink the usage of scala.home, SCALA_HOME, PATH, fsc, scalac etc.

19. boris -- 2009-08-16 09:00

from the command line I get indeed version 2.8