DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Modernizing Apache Spark Applications With GenAI: Migrating From Java to Scala
  • Mastering Advanced Aggregations in Spark SQL
  • Thermometer Continuation in Scala
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide

Trending

  • What Nobody Tells You About Multimodal Data Pipelines for AI Training
  • LLM Integration in Enterprise Applications: A Practical Guide
  • Lambda-Driven API Design: Building Composable Node.js Endpoints With Functional Primitives
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  1. DZone
  2. Coding
  3. Languages
  4. Apache NetBeans and Scala

Apache NetBeans and Scala

Let's get you generating Scala projects in Apache NetBeans! While NetBeans is still incubating, here are the steps to get the necessary foundations set.

By 
Chris Luff user avatar
Chris Luff
·
May. 16, 18 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
13.1K Views

Join the DZone community and get the full member experience.

Join For Free

Whilst NetBeans is incubating, getting the venerable NetBeans Scala Plugin into the IDE running JDK 9 and above is a bit of a trial.

NetBeans is in the incubator, and the Maven artifacts are not being published. What coordinate would they be published under? That is one for another day and involves beer (or your preferred tipple)!

Anyway, for the moment, we have to do a little work to get Scala running on the bleeding edge version of NetBeans. I am going to make the assumption, for brevity, that you have cloned NetBeans.

Firstly, there are a few things we need to clone:

  1. NetBeans from the incubator

  2. nb-repository-plugin from codehaus.
  3. nbscala

You'll also need JDK8 installed — I get a bit cross with all the advice on how to manage Java versions on a Mac (I'm afraid it can't speak to Windows), but ultimately, you'll need to ensure that you have your Java Home set to JDK8. I might write a post about this topic soon because it is just not as complex as some like to make out.

Guess what, we need to build NetBeans. This will take a while, but you get a shiny new version of NetBeans to play with, including JDK10 support. Next, build the nb-repository-plugin. This gets us version 1.4-SNAPSHOT, which includes maven support 3.5.x+.

Next, let's point the nbscala to all these new things. Open up the pom.xml of the parent project  and look for the following two properties:

<nb.installation></nb.installation>
<nb.nbmdirectory></nb.nbmdirectory>


Set the installation property to the NetBeans directory of the one you just built. Don't worry about the nbmdirectory just yet, but most likely it will be the ${projectdir}/target/nbms.

So the next thing is to install all the NetBeans-generated JARs into our the local Maven repository.

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home M2_HOME=/usr/local/Cellar/maven/3.5.3/libexec /usr/local/Cellar/maven/3.5.3/libexec/bin/mvn org.codehaus.mojo:nb-repository-plugin:1.4-SNAPSHOT:populate


Last step before the fun. Build the nbscala plugins.

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home M2_HOME=/usr/local/Cellar/maven/3.5.3/libexec /usr/local/Cellar/maven/3.5.3/libexec/bin/mvn clean install


Once this is done, we get to install the plugins to our new NetBeans installation. All the nbms and JARs you need are in the target directory, 22 in all!!

If everything has gone to plan, you can now generate Scala projects in Apache NetBeans.

NetBeans Scala (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Modernizing Apache Spark Applications With GenAI: Migrating From Java to Scala
  • Mastering Advanced Aggregations in Spark SQL
  • Thermometer Continuation in Scala
  • Deploying a Scala Play Application to Heroku: A Step-by-Step Guide

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook