Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Grails for Netbeans?

I am trying to configure Grails in Netbeans.

  • Grails version:3.2
  • Netbeans: 8.2
  • JDK: 1.8
  • OS: Windows 10

I have install and configured environment path and other stuffs. I can create and run project from the Command Prompt. But I can not create project from netbeans.

Warning |
Unrecognized flag: non-interactive.
Error |
Specify an application name or use --inplace to create an application in the current directory

This error is showing, to create project from Netbeans. I can run the created project though. I have already added Groovy plugin.

How can I solve this problem?

like image 582
Muhaimenul Islam Avatar asked Jan 06 '18 11:01

Muhaimenul Islam


People also ask

How does grails framework work?

The Grails framework takes advantage of the Model-View-Controller (MVC) design pattern to partition responsibilities within the application and to simplify the application architecture. Model classes should represent the domain objects in your system. Controller classes should control the flow of the application.

How to create a Grail Project in NetBeans?

Note, I always create projects on the command line, e.g. "grails create-app myapp ...", then simply use the open project menu in netbeans and it instantly recognises them as grails. Ensure you have gradle plugin installed for netbeans. Then go to File -> Open Project. You should see the project shown by netbeans as a gradle project.

How to install a Grails framework in Java?

A Grails framework runs on top of a Java platform, hence the first step is to install a Java Development Kit (JDK) on your local machine. In the given example, I have installed jdk1.7.0_21 on my local machine. In order to download Oracle JDK 7 installer, visit Oracle’s official website.

What is the default configuration for a Grails application?

Configuration in Grails is generally split across 2 areas: build configuration and runtime configuration. Build configuration is generally done via Gradle and the build.gradle file. Runtime configuration is by default specified in YAML in the grails-app/conf/application.yml file.

How do I use Grails'interactive mode?

You can also use Grails' Interactive Mode to run the Grails runtime, from which you can issue any Grails command without waiting for the runtime to spin up for each task. In this guide we will be preferring the Grails wrapper for most commands.


2 Answers

I don't think you are doing anything incorrectly. I have an environment very similar to yours (Grails version: 3.3.2, Netbeans: 8.2, JDK: 8u151, OS: Windows 10) and I see the same error: Specify an application name or use --inplace...

This is a known issue with NetBeans 8.2 that has already been bug reported; see Bug 258407 - Error when creating a Grails 3.1.x project. The problem has been confirmed to exist in Grails releases 3.1.0 up to 3.1.4, but I see the same issue in 3.3.2, and there is no fix for NetBeans 8.2.

However, I successfully created a Groovy/Grails application using JDK 8u151 with a DEV release of NetBeans which you can download from here: http://bits.netbeans.org/download/trunk/nightly/latest/

Note the caveat that comes with using DEV releases of NetBeans:

These builds are still under development and could contain defects that lead to data loss. They are meant for evaluation of new features. As always, be sure to back up your changes if you use these builds on your production code.

As long as you can you can live with that situation, using a DEV release is your (only) solution for creating Grails 3.x applications in NetBeans.

One final point: unlike NetBeans 8.2, DEV releases of NetBeans support Java 9 as well as Java 8, but don't use Java 9 when creating a Groovy/Grails applications. It won't work for a completely unrelated reason.

like image 191
skomisa Avatar answered Sep 27 '22 20:09

skomisa


I'm using Windows 8 and Grails 3.3.8, but the following worked for me:

  1. Create the project using system command line (I used instructions in this page: how to create grails project through windows command promt).
  2. Import the project to Netbeans 8.2 by clicking on File > Open Project... and selecting the project folder.
like image 25
user8640198 Avatar answered Sep 27 '22 20:09

user8640198