5
votes

I have started using Play 2.1.0 and I would like to be able to use NetBeans to develop Play Java applications. I'm not really interested in using the IDE to run or test the applications since I can do that from the command line (not that I would mind if I could also have IDE support for that) but I would like to be able to open and edit my project in NetBeans without getting annoying errors where they don't really exist. I am currently using NetBeans 7.3 so I first tried to use the nbplay plugin, however it wouldn't recognise all my imports or managed classes produced by Play. I then tried to import the project as Eclipse project, as described in this and this question, which worked better, but while working my way through one of Play's Java tutorials I am still getting the following errors which make it really annoying to work with NetBeans:

  1. I get an "Expected an operand but found error" error in main.scala.html where @content is used, although I have instructed the IDE to disable HTML error checking for this file.
  2. In my model classes I get errors because the classes do not declare a no-argument constructor and have public variables for persistent attributes.
  3. Any other errors I have not come across yet?

Has anyone managed to make Play 2.1.0 work with NetBeans without getting any of the above errors? I could probably live with the first one (although it would really annoy me) but the rest are showstoppers.

1

1 Answers

-1
votes

Be aware that the Java hints can be enable or disable in Tools -> Options -> Editor -> Hints -> Select java language.

NetBeans now has Native Support for Play Framework 2.3.x and above: http://nbpleasureplugin.com/documentation/installation.html No Command line needed at all.

The most important features are:

  • Create, run, debug and test your app directly in the IDE
  • Routes files support (Syntax coloring, Syntax Error highlighting, Autocompletion, Code navigation, Show implementation code (without navigate to source), Hint to Create method when it doesn’t exist, formatting, Mark occurrences)
  • Scala Template support (Syntax coloring, Syntax Error highlighting, Autocompletion, Code navigation, Show implementation code (without navigate to source), formatting, Mark occurrences) application.conf support (Syntax coloring, autocompletion with documentation, formatting, mark occurrences)
  • Dependency Management (Search on Maven and add them to build.sbt)
  • 2 Code Coverage too.s supported (jacoco and scoverage)
  • Test Single File
  • SBT file minimal support
  • Configurations (Formatting indentation, syntax coloring, port to use, activator parameters, etc.) *Support play version from 2.3.x and above

Note: I created this plugin.

Also I see this could help you: How do I use Play Framework 2.0 in netbeans