In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to configure your favorite IDE in the Play framework, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
It is easy to work with Play. You don't even need a complex IDE, because Play automatically compiles and refreshes your modified source files, so you can easily work with a simple text editor.
However, trendy Java IDE provides some cool and efficient features, such as autocompletion, just-in-time compilation, refactoring assistance, and debugging. Play supports NetBeans, IntelliJ IDEA and Eclipse platforms platforms.
Generate Eclipse configuration file
Play provides a command to generate the Eclipse configuration. To convert a Play application into an Ecipse project, you can use the eclipsify command:
# play eclipsify myApp
Then, you need to use File/Import/General/Existing project... The menu imports the application into your workspace.
The eclipsify command generates the launcher for several applications, and the main launcher can only be used through the Run As command of Eclipse. You can start a debugging session through Debug As at any time, and then use Connect JPDA launcher, and stopping the debugging session does not cause the server to terminate.
If you make any important changes to the application, such as changing classpath, you need to use eclipsify to regenerate the Eclipse configuration file.
In addition, there is an Eclipse plug-in in the Play directory. To install it in the support/eclipse/ directory, simply copy the JAR file you found in that directory to the dropins folder in the Eclipse installation directory.
When you are working with a team to develop, please do not submit the Eclipse configuration file!
The generated Eclipse configuration file contains the absolute path to the Play framework installation directory. These are specific to your own installation. When you and your team work together on an application, each developer must have his or her own private Eclipse profile.
Generate NetBeans configuration file
Play provides a command to generate the NetBeans configuration. To convert a Play application into a NetBeans project, you can use the netbeansify command:
# play netbeansify myApp
Then you can open the application as a NetBeans project.
Start the application using the standard Run button. When the application starts, you can start a debugging session at any time using the Debug button. Stopping the debugging session will not cause the server to terminate.
If you make any important changes to the application, such as changing classpath, you need to use netbeansify to regenerate the Eclipse configuration file.
When you are working with a team to develop, please do not submit the nbproject/ directory!
The generated NetBeans configuration file contains the absolute path to the Play framework installation directory. These are specific to your own installation. When you and your team work together on an application, each developer must have his or her own private NetBeans profile.
Generate IntelliJ IDEA configuration file
Play provides a command to generate the IntelliJ IDEA configuration. To convert a Play application to an IntelliJ IDEA project or module (module), you can use the idealize command:
# play idealize myApp
You can then use the import module to import the application into IntelliJ.
You can use the Run and Debug commands in the context menu.
When you are working with a team to develop, please do not submit .iml files!
The generated IntelliJ IDEA configuration file contains the absolute path to the Play framework installation directory. These are specific to your own installation. When you and your team work together on an application, each developer must have his or her own private IntelliJ IDEA profile.
Textmate
Download and install the software package provided by Textmate to make syntax coloring and code completion automatically. The package also simplifies navigation between the controller and the view.
Manually configure your favorite editor
Because Play applications are standard Java applications, you don't need specific plug-ins to directly use your favorite editor. However, the premise is that you need to know a little bit about how Play works.
Classpath configuration
The classpath of the Play application is established as follows (in order):
Conf directory of the application
$PLAY_PATH/framework/play-$version.jar file
All Jar files in the applied lib/ directory
All Jar files in the $PLAY_PATH/framework/lib/ directory
Prompt
If you enable any module, you also need to add the library files involved in the module (from the $module/lib/ directory) to classpath.
Run the main class
To start a Play application, simply run the play.server.Server class. Play uses the "application.path" system property to locate the application to run. This value is usually passed like this:
Java-Dapplication.path= "/ app/path"...
Java Agent
To enable HotSwap hot loading technology, you must load a Java proxy packaged in play.jar. It usually goes like this:
Java-javaagent: "$PLAY_PATH/framework/play.jar"...
This is not required, but it will speed up the reloading of the class.
Debugging problem
Play automatically reloads the Java class when the Java source code is modified. However, because Java does not fully support class overloading, the JDPA debugger can easily be confusing: breakpoint commit may fail or the debugger may stop on the wrong line of code when debugging enters the code.
To avoid this, a better way is to modify the code and start a new debugging session. Fortunately, JPDA supports connecting and disconnecting the debugger at any time without the need to restart JVM.
Therefore, the correct process for debugging should be:
Modify the source code.
Refresh the browser to see the results. (at this point, Play will reload the changes to the code and redefine it in JVM.)
If an error occurs and you need to debug, you can start a new debugging session.
Debug and fix your code.
Disconnect debugging.
By following the above process, you can ensure that the debugger is always synchronized with the code loaded in JVM.
On how to configure your favorite IDE in the Play framework is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 248
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.