How to create Java project in Netbeans, without using Maven as default?

19,973

The project templates were revised in Apache NetBeans 11.0 to give Maven projects greater prominence. From an Apache NetBeans blog post:

Restructuring of Project Templates in Apache NetBeans

There's been lots of discussion in the Apache NetBeans community about how best to express the fact that Apache Maven and Apache Gradle are more modern choices to be aware of than Apache Ant, while at the same time not implying that there's anything wrong with using Apache Ant.

Here's what we seem to have reached consensus around, i.e., move all Ant-based project templates into a separate Ant-specific folder, while putting the other two build systems higher and therefore more prominently in the list:

new project templates

With the above, someone is less likely to simply go to the no-longer-existing Java category and then end up with an Ant-based project, without thinking about it. By default, the user of Apache NetBeans is now encouraged to consider Apache Maven and Apache Gradle first. The old Ant-related categories are still there, so as not to confuse anyone completely, just structured within a lower ranked "Java with Ant" category. The above also solves the discussion re "Java EE", i.e., here the idea, from discussions, is to name the category "Java Enterprise".

At startup, all categories are closed, i.e., none is more prominent initially than any other.

An objection one could have is that, if you're a complete Java newbie, you won't know what Maven, Gradle, or Ant are. Well, that has always been the case and NetBeans has artificially hidden that choice by having a category simply named "Java", which then resulted in everyone ending up with Ant-based projects. To turn that around and have a category simply named "Java" that results in Maven-based projects is probably not right either, i.e., a careful balance needs to be struck.

So if you created a project using File > New Project... > Java > Java Application in earlier releases of NetBeans, you should use File > New Project... > Java with Ant > Java Application in NetBeans 11.0.

Notes:

  • NetBeans Bug Report NETBEANS-2040 Maven First in New Project Wizard refers.
  • Also see the discussion at the start of this YouTube video The Rough Guide to Apache NetBeans 11.0.
  • Other project wizard changes in NetBeans 11.0:
    • In NetBeans 11.0 I had to install the Gradle plugin (Tools > Plugins > Available Plugins > Gradle) in order to see Java with Gradle in the Project Wizard.
    • In earlier releases of NetBeans you created a Java Enterprise project using File > New Project... > Java EE > ..., but in NetBeans 11.0 this has changed to File > New Project... > Java with Ant > Java Enterprise > ...
Share:
19,973

Related videos on Youtube

Chris Kcas
Author by

Chris Kcas

Electronics Engineer, and future software engineer. Space technology enthusiast. Perpetual home-improver.

Updated on September 15, 2022

Comments

  • Chris Kcas
    Chris Kcas over 1 year

    I'm currently trying to create a basic Java project. The first option that appears is "Java with Maven", which I already used, but isn't giving me the "Create Main Class" option that I need.

    I'm using Apache Netbeans IDE 11.0, running on Windows 10, x64. I've given it a whole day, updating and installing the most recent JDK versions I found, and still I'm unable to make it work.

    I've also read this answer, but it's not working: Can't create project on Netbeans 8.2

    Here's an image of what I'm getting:

    ProjectWizrdOnNetBeans11

    Any help is appreciated, thanks.

  • chitgoks
    chitgoks about 3 years
    Somehow netbeans 12.3 just rendered my ant project useless. run menu items are disabled. used to work before but now, when i select the folder it says to open the project right away. problem is, if i do, it makes it a maven project instead.
  • skomisa
    skomisa about 3 years
    @chitgoks Sound like a bug. Perhaps create a new SO question for that? You could also report the issue to NetBeans.
  • chitgoks
    chitgoks about 3 years
    had to change my source folder to src/main/java. no choice. the old project just had src/ and it worked before until 12.3