Search code examples
grailsnetbeansgroovy

Why I can't create new grails application in Netbeans 8.2?


OS: Windows 10
JDK: jdk1.8.0_65
IDE: Netbeans 8.2

Steps I had taken:
1. I had installed Netbeans, selecting the ALL column, meaning it can support Groovy or the grails application.
2. I also had installed the latest version of Grails which is the grails-3.3.5.
3. After installing everything, I opened Netbeans.

STEPS I HAD TAKEN IN NETBEANS
File > New Project > Groovy > Grails Application > then I clicked next.
After that I had clicked the Configure Grails... button. Then I copy pasted the file path of my grails home directory (in my case that is C:\Program Files\NetBeans 8.2\grails-3.3.5) under the textbox of Grails Home then clicked on OK.

The problem here is that I cannot create a new project. It kept on displaying this message box: "Unexpected error occured while creating the application. See output window for more details."
And there it shows the error: "Specifiy an application name or use --inplace to create an application in the current directory"



What should I do? Please help me. I need this for my job application's exam. Thank you so much.


Solution

  • I get exactly the same error as you when creating a Grails 3.3.5 project in NetBeans 8.2 on Windows 10. This is because of a longstanding bug in NetBeans: Bug 258407 - Error when creating a Grails 3.1.x project, which also impacts more recent releases of Grails.

    Although that bug has Status: VERIFIED FIXED, unfortunately the fix was not applied to release 8.2 itself ("...this bug is fixed in development builds not 8.2"). You have two possible workarounds:

    • Install a DEV build of NetBeans 8.x which contains the fix.
    • Install the beta release of NetBeans 9.0 which contains the fix.

    Option 1: Using a DEV release of NetBeans

    • Download the most recent nightly Dev build of NetBeans 8.2.
    • Activate Groovy and locate Grails 3.3.5 in the same way as you did on NetBeans 8.2.
    • You can then successfully create your Grails application using the Groovy > Grails Application project wizard, and run it:

    DevBuildGrails1

    Option 2: Using a beta release of NetBeans 9.

    • Download and unzip NetBeans 9 beta from the Apache NetBeans 9.0 Beta web site.
    • Start NetBeans 9 beta and install the Groovy/Grails plugin:

    InstallGrailsPlugin

    • Locate Grails 3.3.5 in the same way as you did on NetBeans 8.2 (Tools > Options > Miscellaneous > Groovy > Grails Home).
    • You can then successfully create your Grails application using the Groovy > Grails Application project wizard, and run it:

    Beta9Grails