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
Newsletter
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

  • Google Cloud KMS vs. AWS KMS: Java Encryption Guide
  • GET, POST, PUT, DELETE: Choosing HTTP Verbs in a Real .NET Core Web API, Not Just by the Textbook
  • AI-Assisted Refinement Preparation
  • Building IoT Time-Series Applications With Java and Apache IoTDB

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
May. 16, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
13.3K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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