Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Play Framework 2.0 in netbeans

Play Framework 2.0 doesn't seem to have much / any support for Netbeans. I'm currently just using it as an editor (loading the files using the favorites tab), but it's a little frustrating that Netbeans doesn't recognise any of the libraries / api's.

This means that EVERYTHING is underlined in red.

Trying to create a free-form project requires a build file, so I get stuck there too.

Any ideas appreciated...

like image 367
sparkyspider Avatar asked Apr 11 '12 20:04

sparkyspider


People also ask

How do I run a play Framework project?

Generate configuration To debug, start your application with sbt -jvm-debug 9999 run and in Eclipse right-click on the project and select Debug As, Debug Configurations. In the Debug Configurations dialog, right-click on Remote Java Application and select New. Change Port to 9999 and click Apply.

How do I run play framework in Windows?

To run the Play framework, you need JDK 6 or later. If you are using MacOS, Java is built-in. If you are using Linux, make sure to use either the Sun JDK or OpenJDK (and not gcj, which is the default Java command on many Linux distros). If you are using Windows, just download and install the latest JDK package.

Is Play framework still used?

Play is rock-solid and used by hundreds of thousands of Java and Scala developers every month. Play is still extremely relevant to today's application and web development and has a passionate and very capable community around it ensuring that it has many good years left.


3 Answers

  1. Create a play project as per normal way.
  2. From the play CLI select play eclipsify to create an eclipse project.
  3. From netbeans, select File > Import Project > Eclipse Project
  4. Select Import Projects Ignoring Dependencies
  5. In Project to Import, insert the root of your play application.
  6. In Destination Folder, also insert the root of your play application.
  7. Press Finish.
like image 96
sparkyspider Avatar answered Oct 24 '22 03:10

sparkyspider


Use the eclipse support to generate an eclipse project and then import that into NetBeans

like image 33
fonseca Avatar answered Oct 24 '22 04:10

fonseca


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)
  • Dependency Management
  • 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.

like image 6
Pedro Hidalgo Avatar answered Oct 24 '22 04:10

Pedro Hidalgo