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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Building Micronaut Microservices Using MicrostarterCLI
  • My Experiences with Maven in IntelliJ IDEA and NetBeans IDE
  • The Best Node.js IDEs in the Market Right Now
  • Authentication With Remote LDAP Server in Spring Web MVC

Trending

  • Build Your First AI Model in Python: A Beginner's Guide (1 of 3)
  • Grafana Loki Fundamentals and Architecture
  • How to Format Articles for DZone
  • Ensuring Configuration Consistency Across Global Data Centers
  1. DZone
  2. Coding
  3. Tools
  4. Using IntelliJ IDEA for NetBeans Platform Development

Using IntelliJ IDEA for NetBeans Platform Development

By 
Geertjan Wielenga user avatar
Geertjan Wielenga
·
Mar. 04, 09 · News
Likes (0)
Comment
Save
Tweet
Share
30.0K Views

Join the DZone community and get the full member experience.

Join For Free

On jetbrains.com there's a rather impressive article entitled Using IntelliJ IDEA for Eclipse RCP development. Let's take a look at what the NetBeans Platform equivalent would look like.

We'll start with one of the standard NetBeans Platform sample applications distributed with NetBeans IDE, the Paint Application.

The application consists of an application module that provides a canvas for painting, with some 3rd party libraries wrapped into supporting modules. In other words, a very realistic example representing a real life scenario.

We're going to (1) open that application into IntelliJ and then (2) deploy it from IntelliJ, with this result:

In the picture above, take a look at the application structure, as well as the running application itself. That's what we're going to be creating in the steps that follow. I.e., we will make full use of the NetBeans Platform, while using IntelliJ to do so.

  1. Create the Application. Open NetBeans IDE and create the Paint Application, which you can find in the New Project dialog.

  2. Import the Application into IntelliJ. Open IntelliJ and choose File | New Project | Create project from scratch. Click Next. In "Project files location", set the "PaintApp" root folder. Type "PaintApp" in "Name". Click Next and keep clicking Next until you can click Finish. I.e., don't change any of the defaults. Now the application is open in IntelliJ.

  3. Add the NetBeans Platform to the Classpath. Right-click the main "PaintApp" node and choose "Module Settings". In Dependencies, create a new project library that contains all the JARs that you can find in the NetBeans installation directory's 'platform9' folder. Make sure to look in the 'core', 'lib', and 'modules' folders. You should end up with a very long list of JARs. Also make sure to add 'ColorChooser.jar' (which is in 'release/modules/ext' within the Color Chooser module) in the same way.

  4. Create a Runtime Configuration. In the toolbar, click 'Edit Configurations'. Create a new configuration, named 'NetBeans' (for example, but name it whatever you like). Set 'org.netbeans.Main' as the 'Main class' (you should be able to browse to it in 'boot.jar'). in 'VM parameters', pass in some VM options for setting the user directory of the application (which would normally be set via etc/netbeans.conf when NetBeans IDE starts up, which it won't do in our case), as well as the home directory. The user directory can be anywhere, while the home directory must be the cluster that is created by the build process:
    -Dnetbeans.user="/home/geertjan/idea/paint-userdir" -Dnetbeans.home="/home/geertjan/idea/PaintApp/build/cluster"

    The above implies that the cluster exists, which implies that a build has been performed. That's why I do the build from NetBeans IDE. That creates the cluster and then the above VM option works. Instead of VM options, you can also use other approaches to ensure that the application knows where the installation and the user directory are, as discussed here in the comments.

  5. Turn Folders into Source Folders. Go back to the Module Settings and then use the Sources tab to set 'branding' and 'build' as sources. (After you do this, the folders will turn blue.) The 'Paint/src' should already be marked as sources.

Now run the application, using the runtime configuration you defined earlier and you should see your application deployed. Now do the same to the FeedReader Application, which is also distributed with NetBeans IDE, and you should end up with a successful result, following the principles outline above.

Finally, what's the benefit of all this? Well, for far too long IntelliJ users have been excluded from the wonderfulness of the NetBeans Platform. Now, following these instructions, you can at least get started. You'd use NetBeans IDE for generating the project structure and API stubs, as well as for the Matisse GUI Builder's support for the TopComponent class (and other UI classes), after which you'd do your coding in the IntelliJ Java editor. (And the IntelliJ XML editor has better support for the NetBeans Platform layer.xml file than NetBeans IDE does.) Or you'd have different developers working in different IDEs, sharing the same codebase in the way outlined above.

An interesting discovery is that a NetBeans Platform application deploys much more quickly from IntelliJ than it does from NetBeans IDE.

 

intellij NetBeans application

Opinions expressed by DZone contributors are their own.

Related

  • Building Micronaut Microservices Using MicrostarterCLI
  • My Experiences with Maven in IntelliJ IDEA and NetBeans IDE
  • The Best Node.js IDEs in the Market Right Now
  • Authentication With Remote LDAP Server in Spring Web MVC

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!