Loading an ant project in netbeans
I am mainly a C# guy but I do know a bit of java (its been a few years since I did it and I was doing basic classwork style projects (simple calculators, playing card games, ect...) ). Now i have the task of editing a GPL project and tweak some things to customize it to our use.
The issue I am having is I have never imported other peoples code in java before. This appears to be a ant project however I have never even done a ant project before. I created a "free form project" in NetBeans and added the build xml, it appeared to get all the source folders I need, however when I run the build-common task (init-common works fine) i get:
build-common:
E:\Java\JavaRDP1.1\rdpclient\build-common.xml:54: The following error occurred while executing this line:
java.io.FileNotFoundException: E:\Java\JavaRDP1.1\rdpclient\${commonxml} (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:268)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:177)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:393)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:281)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
BUILD FAILED (total time: 0 seconds)
It appears to be using the placeholder ${commonxml} instead of the actual file (build-common.xml). What do I need to do to fix my errors, and if I am doing this the totally wrong way and there is a better way than creating a开发者_Go百科 "Free form project" please let me know.
Every tutorial that I have googled have been for creating a new ant project from scratch, I have not been able to find anything helpful on importing a existing project.
EDIT: Here is a copy of the build-common.xml file if it helps
My advise would be to try the automatic project plugin for netbeans which should be available in the plugin update center inside the IDE. Using this plugin netbeans skips its normal build system and instead uses the provided build script directly.
I needed to generate a project.properties file and put this in it
build.dir=Build
dist.dir=Dist
src.dir=src
commonxml=build.xml
java.log4j11.package=log4j-java1.1
java.getopt.package=gnu-getopt-1.0.11-java\\lib
That allowed me to build.
The main source of your problem is Netbeans, it uses Ant as basis for all its tasks. If you want to customize the project you are describing, perhaps a simple text editor and a tutorial is the best choice.
精彩评论