I have a sample code that was built with Netbeans.
It has a build.xml file so I downloaded ant and try to run it.
I've got this error message:
...... nbproject\build-impl.xml:76: Platform is not correctly set up
For what I can see, this is fixed by "simply" downloading Netbeans and running the sample from there, but... I don't want to install it to run a 10 files sample.
Is there a workaround to run Netbeans projects with Java? What's the correct .properties file I have to modify?
It is possible to run the NetBeans generated projects straight from Java/ANT, but you may need to manually set some of the properties and/or add paths to jar files.
Unfortunately, NetBeans tends to include taskdef's using their own JAR files and reference properties that are defined only in the /nbproject/private/private.properties
files, which usually get set when you first open the NetBeans project or modified as you edit the project in the IDE.
If you inspect the build-impl.xml
you should be able to find the property and derive what value needs to be set(OS platform), then either:
/nbproject/private.properties
build.xml
-DPlatform=Foo
Personally, I like the structure of the NetBeans generated ANT files and targets, but hate how much custom/proprietary stuff they jam in that makes it hard to run without NetBeans.
For example:
ant -Dplatforms.JDK_1.7.home=/opt/jdk
I've just successfully built NetBeans project with ant. These were the things I had to do:
<NetBeans-folder>
/java2/ant to a "Netbeanless" machine<platform-name>
.home=<path to platform>
<path to nb-ant>
/extra/org-netbeans-modules-java-j2seproject-copylibtask.jarant -propertyfile ant.properties
It works, but doesn't make me happy. I would either like to find the way to reuse project.properties, or to automatically translate it to a "resolved" version (step 3). Build could then be automated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With