使用Netbeans IDE, 在play项目中如何运行单个java文件

使用Netbeans IDE, 在play项目中如何运行单个java文件
要如何配置才能运行单个文件呢,

目前情况如下:
1. 右击单个java文件 -> 运行文件 , netbeans会生成一个 nbproject\ide-file-targets.xml 文件
2. 运行是日志
ant -f D:\\Project\\myapp\\nbproject\\ide-file-targets.xml -Drun.class=com.e5ex.util.JsonUtil run-selected-file-in-app
java.lang.NoClassDefFoundError: util/JsonUtil
...
3. ide-file-targets.xml 文件详情如下:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="myapp-IDE">
<property name="ant.script" value="D:\Project\play-1.2.4\framework\build.xml"/>
<property name="application.path" value="D:\Project\myapp"/>
<property name="application.name" value="myapp"/>
<!-- TODO: edit the following target according to your needs -->
<!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
<target name="run-selected-file-in-app">
<fail unless="run.class">Must set property 'run.class'</fail>
<java classname="${run.class}" failonerror="true" fork="true">
<classpath>
<pathelement path="conf;D:\Project\play-1.2.4\framework\play-1.2.4.jar;..."/>
<pathelement location="nbproject/classes"/>
</classpath>
</java>
</target>
</project>

请问我要如何修改这配置文件, 还是其他配置?!

我也在用play框架,单个文件java?是有main方法的话直接右键运行就可以了。
快捷键:F6/Shift-F6 运行主项目/文件
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-27
打开需要运费的源文件。右击-运行当前文件或者调式当前文件。追问

我的情况是在在play framework项目中

第2个回答  2015-08-14
只要有main方法,你直接右击你需要运行的java类,就可以运行了。
第3个回答  2013-09-27
学习学习,有大神吗