NetBeans



The HTML for Java & NetBeans API is a classical NetBeans module. However it depends on other modules provided by the HTML for Java project and those are OSGi bundles. As such, when one decides to use this module, one needs to turn on an OSGi container inside of the NetBeans Platform. It can be either Felix or NetBeans version of Equinox. 'NetBeans is a modern, lightweight and fully capable IDE. It is unique among current open-source IDEs, in that it is the most advanced for addressing our primary challenges. NetBeans IDE presents standard operations in a way that really minimizes hunting around and wasting time, to find out how to accomplish what you need to do.'

Skip to end of metadataGo to start of metadata

12.0 is primarily a consolidation of the minor releases 11.1, 11.2, and 11.3. There is as little innovation as possible in 12.0 and as much qualitative solidifying of existing features and functionality.

The program through which qualitative consolidation takes place for 12.0 is NetCAT 12.0.

Focus areas of qualitative consolidation in NetCAT 12.0.

Latest
  • Start up experience (new spec to be created that covers the Installer, including installing subsets, e.g., PHP only, start up experience, performance, etc, first impressions)
  • Java – prioritize new Java language features
  • Jakarta EE (including Payara)
  • JavaFX (with Maven, not Ant)
  • Maven
  • Gradle (no test spec for this yet, since this is a new feature)
  • PHP – focus on the newest PHP language features

In contrast to the above, some examples of areas to deprioritize (and if anyone disagrees, they are very welcome to focus on these areas themselves):

  • Ant
  • CVS/Subversion etc, i.e., anything not Git (and maybe Mercurial)
  • Form Editor/GUI Builder/Matisse

New Features and Enhancements – and Impact on NetCAT 12.0.

Being aware of the below is important when reviewing the test specs. Because the below are new, new tasks or updated tasks need to be provided to the related test specs:

Start up experience

  • Enhancement to the installer enables subsets of Apache NetBeans to be installed (from 11.2).

Java

  • New JDK 14 Language Features
    • JEP 359: Records (Preview), syntax coloring, Navigator support, and formatting of the new Java Records.

      public class Foo {
      public record Bar(String x, int y) {
      }
      }
      Impacted NetCAT test spec: Java Editor, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/448
      Task to be added to test spec:
      Run 12.0 on JDK 14, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), and create a class like the above, copy/pasted from the test spec. The syntax coloring should be not broken and the Navigator should show equals, hashCode, toString, x, y, etc.
      Status: Done. Added as test case 1 in the new section 21, 'Java Language Preview Features', of the above Java Editor test spec.

  • New JDK 13 Language Features
    • JEP 354: Switch Expressions (Preview Feature), as shown below.
      Impacted NetCAT test spec: Java Editor, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/448
      Task to be added to test spec:Run 12.0 on JDK 13 or later, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), verify that the syntax colouring for switch expressions is correct by creating the code above, copy/paste from the test spec, and then seeing that the colors are like the above, not broken, no error markings.
      Status: Done. Added as test case 2 in the new section 21, 'Java Language Preview Features', of the above Java Editor test spec.
    • JEP 355: Text Blocks (Preview Feature), hint for converting to/from text blocks.
      Impacted NetCAT test spec: Java Hints, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/449
      Task to be added to test spec:Run 12.0 on JDK 13 or later, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), and use code like the above, copy/pasted from test spec, to verify the hint works to/from text blocks.
      Status: Done. Added as test case 1 in the new section 5, 'Java Language Preview Features', of the above Java Hint test spec.

      Impacted NetCAT test spec:
      Editor Options, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/451
      Task to be added to test spec:Run 12.0 on JDK 13 or later, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), create code like the above, go to the Options window, go to Fonts & Colors, choose Syntax, 'Java' in Language drop-down, 'Text Block' in Category list, then change the Background to something different and then check that the new color is applied in the editor for text blocks.
      Status: Done. Added as test case 1 in the new section 8, 'Java Language Preview Features', of the above Java Hint test spec.
  • New JDK 12 Language Features
    • JEP 325: Switch Expressions (Preview) – code completion for JEP-325 preview feature for multiple case labels, as shown below.
      Impacted NetCAT test spec: Java Code Completion, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/450
      Task to be added to test spec:Run 12.0 on JDK 13 or later, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), and use code like the above, copy/pasted from test spec, to verify the code completion works as above.
      Status: Done. Added as test case 1 in the new section 14, 'Java Language Preview Features', of the above Java Code Completion test spec.
      Hint for converting to JEP-325 preview feature for switch expressions:

      Impacted NetCAT test spec: Java Hints, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/449
      Task to be added to test spec:Run 12.0 on JDK 12 or later, make sure to uninstall nb-javac if installed, create a Maven application and enable preview features (explain how), and use code like the above, copy/pasted from test spec, to verify the hint works from switch expressions to rule switch.
      Status: Done. Added as test case 2 in the new section 5, 'Java Language Preview Features', of the above Java Hint test spec.
  • New JDK 11 Language Features
    • JEP 330: Launch Single-File Source-Code Programs – a new Java source file can be created in the Favorites window, it can be run, and debugged.

      Impacted NetCAT test spec:
      Java Editor, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/448
      Task to be added to test spec: Run 12.0 on JDK 11 or above, open the Favorites window, create a new Java source file, add some code, run it, and debug it.
      Status:
      Done. Added as test case 1 and 2 in the new section 22, 'Single Java Source Files', of the above Java Editor test spec.
  • Miscellaneous New Java Editor Features
    • 'main' is a new shortcut, that does the same as 'psvm', i.e., creates 'public static void main'

      Impacted NetCAT test spec: Java Code Completion
      , cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/450
      Task to be added to test spec:
      Run 12.0 on JDK 8 or above, create any kind of Java application, add a Java source file, type 'main', without the quotes, press Tab to complete it, and you should see 'public static void main' constructor.
      Status:
      Done. Added as test case 5 in the already existing section 6, 'Generate - constructor', of the above Java Code Completion test spec.
    • Support for inline parameter name hints for Java impacts the Java Editor test spec:
      Impacted NetCAT test spec: Java Editor
      , cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/448
      Task to be added to test spec:
      Select View | Show Inline Hints, add the code above, copy/pasted from the test spec, and you should see the inline hints 'str' and 'fromIndex', like shown above.
      Status:
      Done. Added as test case 6 in the already existing section 9, 'Syntax Coloring', of the above Java Editor test spec.

Java EE

  • Java EE 8 support, for the first time since 11.1, for Maven-based and Gradle-based Web applications. The new Java EE 8 support provides the ability to create Java EE 8 applications and deploy to a Java EE 8 container, with new 'webapp-javaee8' Maven archetype created for use with Apache NetBeans.
    Impacted NetCAT test spec: Maven/Java EE Support Test Specification - javaee, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/title/maven%252Fjava_ee_support_test_specification_-_javaee/12.0
    Task to be added to test spec:

    Status:
    To be done.
  • Support for JSF 2.3; CDI Changes for JSF Artifact Injection (introduced in 11.3), e.g., f:websocket is now supported:
    Impacted NetCAT test spec: Maven/Java EE Support Test Specification - javaee, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/title/maven%252Fjava_ee_support_test_specification_-_javaee/12.0
    Task to be added to test spec:

    Status:
    To be done.
  • Payara integration out of the box for the first time, including Payara Platform 5.194/5.201 support and Payara Server Hot Deploy support.
    Impacted NetCAT test spec: Maven/Java EE Support Test Specification - javaee, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/title/maven%252Fjava_ee_support_test_specification_-_javaee/12.0
    Task to be added to test spec:

    Status:
    To be done.
  • Support for GlassFish 5.0.1.
    Impacted NetCAT test spec: Maven/Java EE Support Test Specification - javaee, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/title/maven%252Fjava_ee_support_test_specification_-_javaee/12.0
    Task to be added to test spec:

    Status:
    To be done.

JavaFX

  • The two OpenJFX Gluon Maven samples are now registered in the New Project dialog (from 11.2) – JavaFX test spec should be enhanced to try out these two samples and make sure they work.
    Impacted NetCAT test spec: JavaFX Create Projects, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/452
    Task to be added to test spec:
    -- Create new FXML JavaFX Maven Archetype (Gluon)
    -- Create new Simple JavaFX Maven Archetype (Gluon)
    Status:
    To be done.

Maven

  • Enabling Java preview features in a Maven project – new task needed in a Maven-related test spec, after creating new Java Maven project, the following must be added and then check whether one or more preview features (see above) can be used in the Java editor.

    Impacted NetCAT test spec: Maven Support Test Specification, https://netbeans-vm.apache.org/synergy/client/app/#/title/maven_support_test_specification/.
    Tasks to be added to test spec: Add above to the POM of a Maven application and verify that preview features can be used.
    Status: To be done. New test case to be added to section 11, 'Edit pom.xml file'.
  • Related to the above, new hint in Java Editor to turn on Preview Features in Maven-based Java projects:
    When the above is clicked, i.e., this happens when a preview feature is recognized but the POM hasn't yet been updated to support it, the following is added to the POM:
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
    <compilerArgs>
    <arg>--enable-preview</arg>
    </compilerArgs>
    </configuration>
    </plugin>
    </plugins>
    </build>

    Impacted NetCAT test spec: Java Hints, cloned to 12.0: https://netbeans-vm.apache.org/synergy/client/app/#/specification/449
    Task to be added to test spec:Run 12.0 on JDK 12, 13, or 14, make sure to uninstall nb-javac if installed, create a Maven application and add a Java source file. Type String text = '' '', at which point the hint should appear, prompting the POM entry above to be generated.
    Status: Done. Added as test case 3 in the new section 5, 'Java Language Preview Features', of the above Java Hint test spec.
  • JaCoCo integration with Maven works again, make sure to check that during NetCAT 12.0 by adding a task around this in the Maven test spec.

    Impacted NetCAT test spec: Maven Support Test Specification, https://netbeans-vm.apache.org/synergy/client/app/#/title/maven_support_test_specification/.
    Task to be added to test spec:Run 12.0, create a Maven application and add a Java source file. Add the above to the POM and then verify that the JaCoCo functionality is available on the Maven project's context menu.
    Status: To be done. New test case to be added to section 11, 'Edit pom.xml file'.
  • Maven-based NetBeans modules can be created again, this was broken, make sure this works again correctly.
    Impacted NetCAT test spec: Maven Support Test Specification - Maven Platform support, https://netbeans-vm.apache.org/synergy/client/app/#/title/maven_support_test_specification_-_maven_platform_support/
    Tasks to be added to test spec:
    -- Run 12.0, create a new Maven NetBeans module, add a Window Component, run it. Should result in NetBeans starting up and having a new window.
    -- Run 12.0, create a new Maven NetBeans application, run it, add a module, add a Window Component, run it. Should result in new NetBeans application starting up and having a new window.

    Status: Done, both these test cases are already in the Maven Support Test Specification - Maven Platform support test spec.
  • Default JDK for Maven projects can be set.

Gradle

  • Enabling Java preview features in a Gradle project – new task needed in a new Gradle-related test spec, after creating new Java Gradle project, the following must be added and then check whether one or more preview features (see above) can be used in the Java editor.

  • Gradle JavaEE Support

PHP

  • PHP 7.4 Language Features and some new hints: see 11.2 Feature: PHP
  • Autocomplete for PHP property and method without $this→


HiDPI and Painting Bugfixes

  • In the editor, fix incorrectly positioned line-width marker (e.g. shown at 82 characters instead of 80 characters), and inaccurate tab alignments. This bug existed at certain editor zoom levels on Windows, Linux, and MacOS, including on non-HiDPI screens.
  • Fix clipped file names in 'Projects' pane on Windows on HiDPI screens.


Reference: Complete Listing of Closed PRs for 12.0

KeySummaryTCreatedUpdatedDueAssigneeReporterPStatusResolution

Working with projects

How do I open a NetBeans project in IntelliJ IDEA?

Use File | New | Project from Existing Sources and select your NetBeans project directory.

When the Import Project wizard opens, select the Create project from existing sources option and then follow the instructions of the wizard.

IntelliJ IDEA will add the necessary definition files (the .idea directory) to your project directory. The NetBeans .nbproject directory and build.xml will remain untouched, and you'll be able to use IntelliJ IDEA along with NetBeans.

During the import IntelliJ IDEA will fix missing libraries, add facets for different Web frameworks and create a run configuration.

If you are using Maven with NetBeans, and you want to import a Maven project into IntelliJ IDEA, select File | Open and then select your project's pom.xml. You'll still need to configure a run configuration, however, all project dependencies will get resolved.

What's the difference between projects and modules?

IntelliJ IDEA creates a project for an entire code base and a module for each of its individual components. So, IntelliJ IDEA module is more like a NetBeans project.

The following table maps the most important NetBeans concepts to IntelliJ IDEA ones.

NetBeansIntelliJ IDEA
ProjectModule
Global libraryGlobal library
Project libraryModule library
Project dependencyModule dependency

Is there a directory-based project format in IntelliJ IDEA?

Yes, there is a .idea directory where project definition XML files are stored. For more information, see Projects.

How do I change the JDK for my project?

  1. Open the Project Structure dialog (File | Project Structure or Ctrl+Alt+Shift+S ).

  2. Under Platform Settings, select SDKs.

  3. Click , select JDK and specify the JDK installation directory.

  4. Click Apply.

  5. Under Project Settings, select Project.

  6. Under Project SDK, select the JDK from the list.

  7. Click OK.

For more information, see SDKs.

How do I add a library to my project?

  1. Open the Project Structure dialog (File | Project Structure or Ctrl+Alt+Shift+S ).

  2. Under Project Settings, select Libraries.

  3. Click , select Java and specify the library location.

  4. Select the modules in which this library will be used.

  5. Click OK.

For more information, see Working with libraries.

How do I configure a Web framework for my project?

In IntelliJ IDEA Ultimate (there's no corresponding functionality in the Community Edition):

  1. Open the Project tool window (for example View | Tool Windows | Project ).

  2. Right-click the necessary module and select Add Framework Support. (Framework support is enabled at a module level.)

  3. In the Add Frameworks Support dialog that opens, select the frameworks to be supported, specify the associated settings and click OK.

For more information, see Add frameworks (facets) and for example Jakarta Server Faces (JSF).

The Run button is disabled. How do I run my application?

The Run button is disabled because there are no run configurations in your project.

If you have a Java class with a main() method, open the corresponding file in the editor, right-click the editing area and select Run '<FileName>.main()'. As a result, the necessary run configuration will be created automatically and then executed.

You can create run configurations yourself: in the main menu, select Run | Edit Configurations |. Click to add a new configuration and choose how you want to run your application.

How do I generate an Ant build script for my project?

Select Build | Generate Ant Build. For more information, see Generate Ant Build file.

How can I open several projects in IntelliJ IDEA simultaneously?

It's possible to work with multiple projects simultaneously using IntelliJ IDEA. To achieve this, you only need to open a project, while another one is already opened, and choose Add to currently opened projects.

How do I close a project?

Select File | Close Project. You can also use File | Exit to close all open projects and quit IntelliJ IDEA.

Where is the Options dialog?

In IntelliJ IDEA, the Settings dialog is used for similar purposes. To open this dialog, press Ctrl+Alt+S.

There is also the Project Structure dialog (Ctrl+Alt+Shift+S) which lets you manage JDKs, libraries, module dependencies, and so on.

For more information, see Settings / Preferences dialog and Project Structure dialog.

How do I start with VCS integration?

The most popular Version Control Systems including Git, Subversion, Mercurial, Perforce, and more are supported by IntelliJ IDEA. VCS integration for your project can be configured in on the Version Control page of the Settings /Preferences dialog. See Version control fore details.

Working with the code editor

Can I use the NetBeans key bindings in IntelliJ IDEA?

Yes, you can.

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Keymap under Appearance and Behavior.

  2. In the right-hand part of the dialog, next to Keymaps, select NetBeans 6.5 from the list.

How does code completion in IntelliJ IDEA work?

The code completion suggestion list appears automatically after you type one or two letters. To narrow down this list, use:

  • Ctrl+Space. The list is reduced to keywords and the names of classes, methods, and fields available in the current context. Note that the list changes when you press Ctrl+Space for the second or third time.

  • Ctrl+Shift+Space. Only the types appropriate for the current context are shown.

For more information, see Code completion.

Is local history in IntelliJ IDEA any different from that in NetBeans?

Local history in IntelliJ IDEA, generally, is more detailed. Whatever you do with a directory, file, class, method or field, or a code block is reflected in your local history. The local history also includes VCS operations.

For more information, see Local History.

Are there any special code analysis features in IntelliJ IDEA?

IntelliJ IDEA can analyze dependencies, data flows and stack traces, find duplicates and evaluate code quality. Just have a look at the options in the Analyze menu.

Can I enable 'mark occurrences' in IntelliJ IDEA?

You can. The corresponding option in IntelliJ IDEA is called Highlight usages of element at caret. This option is enabled by default.

Just in case:

  1. Open the Settings dialog Ctrl+Alt+S.

  2. In the Editor category, select General.

  3. In the right-hand part of the dialog, under Highlight on Caret Movement, select the Highlight usages of element at caret checkbox.

  4. Click OK.

Can I enable 'compile on save' in IntelliJ IDEA?

You can.

To enable automatic compilation on every save (or autosave), turn on the Build project automatically option in the Settings dialog:

  1. Open the Settings dialog Ctrl+Alt+S.

  2. In the Build, Execution, Deployment category, select Compiler.

  3. In the right-hand part of the dialog, select the Build project automatically checkbox.

  4. Click OK.

Note that by default, IntelliJ IDEA saves changed files automatically, so you don't need to use Ctrl+S as frequently as in other IDEs.

Can I enable 'deploy on save' in IntelliJ IDEA?

There is no such option in IntelliJ IDEA settings, however, you can get similar result by choosing an appropriate application update option in the corresponding run configuration.

For more information, see Update applications on application servers.

(The corresponding functionality is available only in IntelliJ IDEA Ultimate. The Community Edition doesn't provide integration with application servers.)

Using plugins

Can I use NetBeans plugins in IntelliJ IDEA?

Unfortunately not. However, a lot of functionality implemented as plugins for NetBeans is available in IntelliJ IDEA 'out of the box'. Besides, there's a lot of plugins for IntelliJ IDEA, so you can always find an IntelliJ IDEA plugin with the functionality similar to that of your favorite NetBeans plugin.

How do I find the plugin that I need?

All the functions related to working with plugins are on the Plugins page of the Settings dialog Ctrl+Alt+S. You can look for, download, install and update the plugins as well as enable and disable them.

For more information, see Plugins and Manage plugins.

How do I install the plugin that I have available on my computer?

  1. Open the Settings dialog Ctrl+Alt+S.

  2. In the left-hand pane, select Plugins.

  3. In the lower part of the Plugins page, click Install plugin from disk.

  4. In the dialog that opens, select the plugin file (normally, a JAR or ZIP).

  5. Click OK.

  6. If asked, restart IntelliJ IDEA.

I'd like to write a plugin for IntelliJ IDEA. Are there any instructions?

Download Netbeans 8.2

Yes, have a look at:

  • IntelliJ Platform SDK Developer Guide.

  • Information for Plugin Developers on the IntelliJ IDEA Plugins page

Is it possible to build NetBeans RCP applications with IntelliJ IDEA?

It is possible, however you won't get the same kind of support you would in the case of NetBeans (wizards, menu actions, and so on). Have a look at Using IntelliJ IDEA for NetBeans Platform Development.

Configuring PHP development environment

What configuration is needed before start?

A lot of IntelliJ IDEA features are available without any configuration right after you launch it. Still, to take full advantage of running your PHP application, you need to configure a PHP interpreter and a server.

If you plan to launch the application locally, you need a PHP engine installed and registered in IntelliJ IDEA, as well as a Web server installed, configured, and integrated with IntelliJ IDEA. You can install these components separately or use an AMP package. For more details about initial environment configuration, refer to Configure PHP development environment.

Netbeans 8.2

If you are going to run and debug an application directly on a remote host, the only thing you need is register access to this host in IntelliJ IDEA to enable synchronization.

Netbeans Download

How do I start with deployment to a remote host?

If you've checked out your project from the remote host, the deployment server is already configured. Otherwise, you will need to get it configured (it can be FTP/SFTP/FTPS server or mounted/local folder) on the Deployment page of the Settings/Preferences dialog. The Remote host tool window is available on the right-hand side of the IntelliJ IDEA window, which can be handy for browsing through your remote server and performing various actions.

Netbeans Vs Eclipse

See Deploy your application for details.

How do I start debugging?

Netbeans Download

IntelliJ IDEA comes with support for both Xdebug and Zend Debugger for debugging and profiling. There is a zero-configuration debugging workflow available, which means that to start debugging you only need to:

Netbeans Ide

  • Click Start Listening for PHP Debugging Connections on the toolbar of the IDE.

  • Place a breakpoint in code by clicking in the editor gutter next to the line.

  • Start debugging in the browser using a plugin or browser bookmarklets.