We have a large project that is created using Vaadin 6.8
We recently decided to upgrade to version 7.
Refactor the code that caused it in line with changes in the framework.
There was a problem: we can not compile widgetset ...
The project was created in Netbeans IDE, a compilation produced with Ant script.
Here's a error:
Here's Ant script:
<import file="nbproject/build-impl.xml"/>
<target name="widgetset-init">
<property name="widgetset" value="user_interface.ApplicationWidgetSet"/>
<property name="widgetset-path" value="user_interface"/>
<property name="client-side-destination" value="web/VAADIN/widgetsets" />
<property name="generate.widgetset" value="1"/>
</target>
<target name="generate-widgetset" depends="widgetset-init, compile" if="generate.widgetset">
<echo>Updating ${widgetset}...</echo>
<mkdir dir="${src.dir}/${widgetset-path}"/>
<java classname="com.vaadin.server.widgetsetutils.WidgetSetBuilder" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="${widgetset}"/>
<jvmarg value="-Xss1024k"/>
<jvmarg value="-Djava.awt.headless=true"/>
<classpath>
<pathelement path="${src.dir}" />
<pathelement path="${javac.classpath}" />
<pathelement path="${build.web.dir}/WEB-INF/classes" />
</classpath>
</java>
</target>
<target name="compile-widgetset" depends="init, widgetset-init, generate-widgetset">
<echo>Compiling ${widgetset} into ${client-side-destination} directory...</echo>
<java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-war" />
<arg value="${client-side-destination}" />
<arg value="${widgetset}" />
<jvmarg value="-Xss1024k"/>
<jvmarg value="-Djava.awt.headless=true"/>
<classpath>
<pathelement path="${src.dir}" />
<pathelement path="${javac.classpath}" />
<pathelement path="${build.web.dir}/WEB-INF/classes" />
</classpath>
</java>
</target>
Related
I am new in Apache ant to build the project. In my Project i used MySQL,junit and hibernate library. I am working on bitbucket pipelines so some suggest use to ant. So i am creating the build.xml file and in there the proecess is clean,build,run junit test case. I did many research how to learn these things but i am stuck in some place. I am success in clean the directory and build also but i am stuck to check junit failure test case. I tried to run these test case in eclipse it shows that test case fail but if i run through ant it always say build successfully. I will provide my project structure .
+HiberTest
--HTest
--lib
--mysql
--junit
-- Hibernate..... so many library
--src
-com
-test
**so many junit files**
-com
-utils
**so many files**
--classpath
--.settings
--.project
**and many more files**
--build.xml
Here is my build.xml files
<project basedir="." default="junit" name="Hibernate test">
<property name="debuglevel" value="source,lines,vars" />
<property name="src.dir" location="HTest/src" />
<property name="build.dir" location="HTest/bin" />
<property name="target" value="1.8" />
<property name="source" value="1.8" />
<property name="test.dir" value="HTest/bin/com/test" />
<path id="classpath">
<pathelement location="bin" />
<pathelement location="HTest/lib/junit3.8.1.jar" />
<pathelement location="HTest/lib/antlr-2.7.7.jar" />
<pathelement location="HTest/lib/byte-buddy-1.10.7.jar" />
<pathelement location="HTest/lib/classmate-1.5.1.jar" />
<pathelement location="HTest/lib/dom4j-2.1.1.jar" />
<pathelement location="HTest/lib/FastInfoset-1.2.15.jar" />
<pathelement location="HTest/lib/hibernate-commons-annotations-5.1.0.Final.jar" />
<pathelement location="HTest/lib/hibernate-core-5.4.11.Final.jar" />
<pathelement location="HTest/lib/istack-commons-runtime-3.0.7.jar" />
<pathelement location="HTest/lib/jandex-2.1.1.Final.jar" />
<pathelement location="HTest/lib/javassist-3.24.0-GA.jar" />
<pathelement location="HTest/lib/javax.activation-api-1.2.0.jar" />
<pathelement location="HTest/lib/javax.persistence-api-2.2.jar" />
<pathelement location="HTest/lib/jaxb-api-2.3.1.jar" />
<pathelement location="HTest/lib/jaxb-runtime-2.3.1.jar" />
<pathelement location="HTest/lib/jboss-logging-3.3.2.Final.jar" />
<pathelement location="HTest/lib/jboss-transaction-api_1.2_spec-1.1.1.Final.jar" />
<pathelement location="HTest/lib/mysql-connector-java-5.1.48.jar" />
<pathelement location="HTest/lib/stax-ex-1.8.jar" />
<pathelement location="HTest/lib/txw2-2.3.1.jar" />
</path>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="init" depends="clean">
<mkdir dir="${build.dir}" />
<copy includeemptydirs="false" todir="${build.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.launch" />
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.dir}" includeantruntime="false" source="${source}" target="${target}">
<src path="${src.dir}" />
<classpath refid="classpath" />
</javac>
</target>
<target name="junit" depends="build-project">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<path refid="classpath" />
<pathelement location="HTest/src/com/utils" />
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.dir}" includes="*.java" />
</batchtest>
</junit>
</target>
</project>
It always gives me this output:-
clean:
[delete] Deleting directory F:\Repository\Agile\HiberTest\HTest\bin
init:
[mkdir] Created dir: F:\Repository\Agile\HiberTest\HTest\bin
[copy] Copying 1 file to F:\Repository\Agile\HiberTest\HTest\bin
build-project:
[echo] Hibernate test: F:\Repository\Agile\HiberTest\build.xml
[javac] Compiling 3 source files to F:\Repository\Agile\HiberTest\HTest\bin
junit:
BUILD SUCCESSFUL
Total time: 1 second
I want to check that if junit test fail then stop the build process and if passes all without error and then i want to create executable jar files
Thanks in advance
The build starts in "build" and the hierarchical never call junit. Try to change:
<target depends="build-project" name="junit" />
I am a beginner in Ant and GWT and I was creating a new Ant project in GWT by following the steps mentioned on this GWT page: webAppCreator under the Creating an Ant project section. I was able to create this project successfully but I got the error build.xml does not exist! in the Command Prompt log. I am unable to fix this problem even after following all the steps mentioned here : ant build.xml file doesn't exist.
Here is my Command Prompt log:
C:\Users\TEST>webAppCreator -junit D:\SELENIUM\junit-4.10.jar -out foo com.example.foo.Foo
Generating from templates: [sample, eclipse, readme, _eclipse-test, _sample-test, ant]
Created directory foo
Created directory foo\src
Created directory foo\src\com\example\foo
Created directory foo\src\com\example\foo\client
Created directory foo\src\com\example\foo\server
Created directory foo\src\com\example\foo\shared
Created directory foo\test
Created directory foo\test\com\example\foo
Created directory foo\war
Created directory foo\war\WEB-INF
Created directory foo\test\com\example\foo\client
Created file foo\src\com\example\foo\Foo.gwt.xml
Created file foo\src\com\example\foo\client\GreetingService.java
Created file foo\src\com\example\foo\client\GreetingServiceAsync.java
Created file foo\src\com\example\foo\client\Foo.java
Created file foo\src\com\example\foo\server\GreetingServiceImpl.java
Created file foo\src\com\example\foo\shared\FieldVerifier.java
Created file foo\war\WEB-INF\web.xml
Created file foo\war\Foo.css
Created file foo\war\Foo.html
Created file foo\war\favicon.ico
Created file foo\.classpath
Created file foo\.project
Created file foo\Foo.launch
Created file foo\README.txt
Created file foo\FooSuite-dev.launch
Created file foo\FooSuite-prod.launch
Created file foo\test\com\example\foo\FooJUnit.gwt.xml
Created file foo\test\com\example\foo\FooSuite.java
Created file foo\test\com\example\foo\client\FooTest.java
Created file foo\build.xml
C:\Users\TEST>ant build
Buildfile: build.xml does not exist!
Build failed
C:\Users\TEST>ant devmode
Buildfile: build.xml does not exist!
Build failed
Here is my build.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<project name="Foo" default="build" basedir=".">
<!-- Arguments to gwtc and devmode targets -->
<property name="gwt.args" value="" />
<!-- Configure path to GWT SDK -->
<property name="gwt.sdk" location="D:/GWT/gwt-2.8.1/gwt-2.8.1" />
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<pathelement location="${gwt.sdk}/gwt-dev.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar"/>
<fileset dir="war/WEB-INF/lib" includes="**/*.jar"/>
<!-- Add any additional non-server libs (such as JUnit) here -->
</path>
<target name="libs" description="Copy libs to WEB-INF/lib">
<mkdir dir="war/WEB-INF/lib" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
<copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />
<!-- Add any additional server libs that need to be copied -->
</target>
<target name="javac" depends="libs" description="Compile java source to bytecode">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="war/WEB-INF/classes"
source="1.7" target="1.7" nowarn="true"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="gwtc" depends="javac" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="512m">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="com.example.foo.Foo"/>
</java>
</target>
<target name="devmode" depends="javac" description="Run development mode (pass -Dgwt.args=-nosuperDevMode to fallback to classic DevMode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" maxmemory="1g">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.sdk}/gwt-codeserver.jar"/>
</classpath>
<arg value="-startupUrl"/>
<arg value="Foo.html"/>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY, -logLevel DEBUG or -nosuperDevMode -->
<arg line="${gwt.args}"/>
<arg value="com.example.foo.Foo"/>
<arg value="com.example.foo.Foo"/>
</java>
</target>
<target name="javac.tests" depends="javac" description="Compiles test code">
<javac srcdir="test" includes="**" encoding="utf-8"
source="1.7" target="1.7" nowarn="true"
destdir="war/WEB-INF/classes"
debug="true" debuglevel="lines,vars,source">
<classpath location="D:\SELENIUM\junit-4.10.jar"/>
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="test.dev" depends="javac.tests" description="Run development mode tests">
<mkdir dir="reports/htmlunit.dev" />
<junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
<sysproperty key="gwt.args" value="-devMode -logLevel WARN -war www-test" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<pathelement location="src" />
<pathelement location="test" />
<path refid="project.class.path" />
<pathelement location="D:/GWT/gwt-2.8.1/gwt-2.8.1/validation-api-1.0.0.GA.jar" />
<pathelement location="D:/GWT/gwt-2.8.1/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="D:\SELENIUM\junit-4.10.jar" />
</classpath>
<batchtest todir="reports/htmlunit.dev" >
<fileset dir="test" >
<include name="**/*Suite.java" />
</fileset>
</batchtest>
<formatter type="plain" />
<formatter type="xml" />
</junit>
</target>
<target name="test.prod" depends="javac.tests" description="Run production mode tests">
<mkdir dir="reports/htmlunit.prod" />
<junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
<sysproperty key="gwt.args" value="-logLevel WARN -war www-test" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<pathelement location="src" />
<pathelement location="test" />
<path refid="project.class.path" />
<pathelement location="D:/GWT/gwt-2.8.1/gwt-2.8.1/validation-api-1.0.0.GA.jar" />
<pathelement location="D:/GWT/gwt-2.8.1/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="D:\SELENIUM\junit-4.10.jar" />
</classpath>
<batchtest todir="reports/htmlunit.prod" >
<fileset dir="test" >
<include name="**/*Suite.java" />
</fileset>
</batchtest>
<formatter type="plain" />
<formatter type="xml" />
</junit>
</target>
<target name="test" description="Run development and production mode tests">
<antcall target="test.dev" />
<antcall target="test.prod" />
</target>
<target name="build" depends="gwtc" description="Build this project" />
<target name="war" depends="build" description="Create a war file">
<zip destfile="Foo.war" basedir="war"/>
</target>
<target name="clean" description="Cleans this project">
<delete dir="war/WEB-INF/classes" failonerror="false" />
<delete dir="war/foo" failonerror="false" />
</target>
</project>
Can someone please help me to fix this issue?
It seems your build.xml is created in a foo folder.
See this output:
Created file foo\build.xml
Go to the foo directory and then run ant.
C:\Users\TEST>ant build
Buildfile: build.xml does not exist!
Build failed
It means build file is absent in TEST directory. Checking your logs you have one in the :\Users\TEST\foo. So you should navigate into foo than try command via terminal one more time.
if you are on Mac :
brew install ant;
brew install ivy;
ant ivy-bootstrap ;
then go to top of ant project;
run ant
I am trying to build jar for my project using jdk 1.8.0_40 and ant version 1.9.0, jar is getting build but while converting this jar to .exe, it is not able to find main class as I have correctly mentioned my main class.I am using eclipse Mar Version: Mars.2 Release (4.5.2).
Earlier I was using jdk 1.7.0_79 version and ant 1.8.4 and everything was working fine.
I am facing issue while upgrading from jdk 1.7.0_79 to jdk 1.8.0_40.
Below is my ant xml which are using to build my jar.Let me know if any configuration is required for java 1.8 to build proper jar.
<property name="jar.name" value="SAFAL.jar" />
<property name="source.root" value="src" />
<property name="class.root" value="bin" />
<property name="lib.dir" value="lib" />
<property name="jar.dir" value="C:\D\SAFAL-Exe" />
<property name="Main-Class" value="com.sungard.ktt.main.SAFALEval" />
<property name="conf.pkj" value="com/sungard/ktt/business/configurations" />
<property name="img.pkj" value="com/sungard/ktt/business/images" />
<path id="project.class.path">
<pathelement location="${class.root}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="clean" description="cleans up build structures">
<delete dir="${class.root}" />
<delete file="${jar.dir}/${jar.name}" />
</target>
<target name="prepare" description="sets up build structures">
<mkdir dir="${class.root}" />
</target>
<target name="compile" depends="prepare" description="Compiles all java classes">
<javac srcdir="${source.root}" destdir="${class.root}" debug="on" optimize="off" deprecation="on" source="1.8" target="1.8" includeantruntime = "false">
<classpath refid="project.class.path" />
</javac>
<mkdir dir="${class.root}/${conf.pkj}" />
<mkdir dir="${class.root}/${img.pkj}" />
<copy todir="${class.root}/${conf.pkj}">
<fileset dir="${source.root}/${conf.pkj}" />
</copy>
<copy todir="${class.root}/${img.pkj}">
<fileset dir="${source.root}/${img.pkj}" />
</copy>
</target>
<target name="jar" depends="compile">
<delete file="${jar.dir}/${jar.name}" quiet="true" failonerror="false" />
<jar destfile="${jar.dir}/${jar.name}">
<fileset dir="${class.root}" includes="**/*.*" />
<fileset dir="${source.root}" includes="**/api/*.java,**/api/vo/*.java"/>
<zipgroupfileset dir="${lib.dir}" />
<manifest>
<attribute name="Main-Class" value="${Main-Class}" />
<attribute name="Class-Path" value="." />
</manifest>
</jar>
</target>
<target name="run">
<java fork="true" classname="${Main-Class}">
<classpath>
<path location="./${jar.name}" />
</classpath>
</java>
</target>
In your java task you are using ./${jar.name} as the location of your jar - this is relying on the current directory being set correctly. All the rest of your code uses ${jar.dir}/${jar.name} as the path for the jar, so change the java task to do the same:
<target name="run">
<java fork="true" classname="${Main-Class}">
<classpath>
<path location="${jar.dir}/${jar.name}" />
</classpath>
</java>
</target>
I have a web project that deploys war files, and right now I can deploy to Glassfish in Windows. Here is my build.xml's necessary part.
<target
name="deploywar"
description="Varolan WAR dosyasını yayınlar." >
<echo level="info" >
Proje sunucuda yayinlaniyor...
</echo>
<exec
executable="cmd"
failonerror="true"
output="${out.txt}" >
<arg value="/c" />
<arg value="${glassfish.path}/glassfish/bin/asadmin --passwordfile ${password.file} deploy --contextroot /GlassfishDeployment ${deployyolu}/${war.filename}" />
</exec>
</target>
BUT I want to re-write my code to work on all platforms. I did some searchs about it which ends up with this helpful page. I wanted to try this method. I added necessary Jar file in to my project. Then I did these task definitions ;
<fileset dir="WebContent/WEB-INF/lib">
<include name="sun-appserv-ant.jar"/>
</fileset>
<target name="as-ant-init">
<taskdef name="sun-appserv-deploy"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask" />
<taskdef name="sun-appserv-undeploy"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.UndeployTask" />
<taskdef name="sun-appserv-component"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.ComponentTask" />
<taskdef name="sun-appserv-admin"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.AdminTask" />
<taskdef name="sun-appserv-jspc"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.SunJspc" />
<taskdef name="sun-appserv-update"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.UpdateTask" />
<taskdef name="sun-appserv-instance"
classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.InstanceTask" />
<taskdef name="wsgen" classname="com.sun.tools.ws.ant.WsGen" />
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" />
<classpath path="${glassfish.path}/lib/sun-appserv-ant.jar" />
</target>
I ended up with this error;
taskdef class org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask cannot be found
Could anyone help me about solving this error or another way to deploy w/o platform?
Thanks.
I used this code fragment from this reply ;
<presetdef name="asadmin">
<java jar="${glassfish.home}/modules/admin-cli.jar" fork="true" jvm="${java.home}/bin/java" >
<arg line="--port ${glassfish.admin.port}" />
</java>
</presetdef>
<target name="deploy">
<asadmin failonerror="true">
<arg value="deploy" />
<arg value="--force=true" />
<arg value="${ear.file}" />
</asadmin>
</target>
It solved my problem.
Thanks to;
https://stackoverflow.com/a/7299637/1400515
I try to install leJOS NXJ on my MAC OS X and run it's sample, but after I do what it wants and export NXJ_Home Path file and etc. and install netbeans plugin and create it sample project (Creating your own project using the Netbeans Plugin). I also follow this structure and replace desire classes.jar from intsall leJOS NXJ installation's lib folder.
I export these 4 lines:
My-macbook-pro:~ AR$ export NXJ_HOME=/Users/AR/Documents/Research-kar/JAVA/lejos_nxj
My-macbook-pro:~ AR$ export DYLD_LIBRARY_PATH=$NXJ_HOME/bin
My-macbook-pro:~ AR$ export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
My-macbook-pro:~ AR$ export PATH=$PATH:$JAVA_HOME/bin:$NXJ_HOME/binamirrezas-macbook-pro:~ AR$
This is leJOS NXJ sample code:
package org.lejos.example;
import lejos.nxt.*;
/**
* Example leJOS Project with an ant build file
*
*/
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
Button.waitForPress();
}
}
and this is related build.xml file:
<project name="Example" default="uploadandrun">
<description>
org.lejos.example.HelloWorld build file
</description>
<!-- set properties for this build -->
<property environment = "env"/>
<property file="build.properties"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="program" value="Example"/>
<property name="main.class" value="org.lejos.example.HelloWorld"/>
<property name="binary" value="${build}/${program}.nxj" />
<!-- deletes generated files -->
<target name="clean" description="clean up all generated files">
<delete dir="build"/>
</target>
<target name="compile" depends="clean"
description="compile the source " >
<!-- Compile the java code from ${src} to ${build} -->
<mkdir dir="${build}"/>
<javac srcdir="${src}" destdir="${build}">
<bootclasspath>
<pathelement location="${nxj.classes.home}/lib/classes.jar"/>
</bootclasspath>
</javac>
</target>
<target name="link" depends="compile"
description="link the binary " >
<!-- Link the binary and create a signature file -->
<java classname="js.tinyvm.TinyVM">
<arg value="--bootclasspath"/>
<arg path="${nxj.classes.jar}" />
<arg value="--classpath"/>
<arg path="${build}" />
<arg value="--writeorder" />
<arg value="LE" />
<arg value="${main.class}"/>
<arg value="-o"/>
<arg value="${binary}"/>
<arg value="-v"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
</classpath>
</java>
</target>
<target name="upload" depends="link"
description="upload the binary" >
<java classname="lejos.pc.tools.NXJUpload" fork="true">
<jvmarg value="-Djava.library.path=${nxj.library.path}"/>
<jvmarg value="-Dnxj.home=${nxj.home}"/>
<arg value="${binary}"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.pctools.jar}"/>
<pathelement location="${nxj.pccomm.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
<pathelement location="${nxj.bluecove.jar}"/>
<pathelement location="${nxj.bluecove-gpl.jar}"/>
</classpath>
</java>
</target>
<target name="uploadandrun" depends="link"
description="upload and run the binary" >
<java classname="lejos.pc.tools.NXJUpload" fork="true">
<jvmarg value="-Djava.library.path=${nxj.library.path}"/>
<jvmarg value="-Dnxj.home=${nxj.home}"/>
<arg value="${binary}"/>
<arg value="-r"/>
<classpath>
<pathelement location="${nxj.jtools.jar}"/>
<pathelement location="${nxj.pctools.jar}"/>
<pathelement location="${nxj.pccomm.jar}"/>
<pathelement location="${nxj.commons.jar}"/>
<pathelement location="${nxj.bcel.jar}"/>
<pathelement location="${nxj.bluecove.jar}"/>
<pathelement location="${nxj.bluecove-gpl.jar}"/>
</classpath>
</java>
</target>
<!-- used only for modifying the Netbeans NXJPlugin -->
<target name="Zip for Netbeans" description="Zip the application to the sample project">
<property name="build.classes.dir" location="/build"/>
<property name="plugin" location="../NXJPlugin/src/nxjplugin/"/>
<zip basedir="." destfile="${plugin}/NXJSampleProject.zip">
<exclude name="**/build/"/>
<exclude name="**/bin/"/>
<exclude name="**/dist/"/>
<exclude name="**/nbproject/private/"/>
</zip>
</target>
</project>
and this is ide-file-targets.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." name="org.lejos.example-IDE">
<target name="run-selected-file-in-src">
<fail unless="run.class">Must set property 'run.class'</fail>
<ant antfile="build.xml" target="uploadandrun">
<property name="main.class" value="${run.class}"/>
</ant>
</target>
<target name="compile-selected-files-in-src">
<ant antfile="build.xml" target="compile"/>
</target>
</project>
I get this error:
run-selected-file-in-src:
clean:
Deleting directory /Users/AR/Documents/NetBeansProjects/NXJSample/build
compile:
Created dir: /Users/AR/Documents/NetBeansProjects/NXJSample/build
Compiling 1 source file to /Users/AR/Documents/NetBeansProjects/NXJSample/build
/Users/AR/Documents/NetBeansProjects/NXJSample/src/org/lejos/example/HelloWorld.java:3: package lejos.nxt does not exist
import lejos.nxt.*;
/Users/AR/Documents/NetBeansProjects/NXJSample/src/org/lejos/example/HelloWorld.java:13: cannot find symbol
symbol : variable Button
location: class org.lejos.example.HelloWorld
Button.waitForPress();
^
2 errors
/Users/AR/Documents/NetBeansProjects/NXJSample/nbproject/ide-file-targets.xml:5: The following error occurred while executing this line:
/Users/AR/Documents/NetBeansProjects/NXJSample/build.xml:24: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
[1]: http://lejos.sourceforge.net/
a little bit late but may other like me are looking for a solution. I am new on leJOS and Netbeans and Java (starting tonight).
My environment is WindowsXP with Netbeans 6.9.1.
leJOS is installed in C:/Programme/leJOS NXJ
First Project: HelloWorld
I fixed it by setting the nxj.home var in the build.properties file laying in the project root directory (here /HelloWorld/ and build.xml is also there).
The nxj.home has to point to the leJOS installation path. In my case:
nxj.home=C:/Programme/leJOS NXJ
Hope it helps
Joe.