title: Can't run leJOS NXJ sample project
body: <p>I try to install <a href="http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/GettingStartedMac.htm" rel="nofollow">leJOS NXJ</a> on my MAC OS X and run it's sample, but after I do what it wants and <a href="http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/GettingStartedMac.htm" rel="nofollow">export NXJ_Home Path file and etc</a>. and install netbeans plugin and create it sample project (<a href="http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/UsingNetbeans.htm#5" rel="nofollow">Creating your own project using the Netbeans Plugin</a>). I also <a href="http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/UsingNetbeans.htm" rel="nofollow">follow this structure</a> and replace desire classes.jar from intsall leJOS NXJ installation's lib folder.</p>
  
  <p>I export these 4 lines:</p>
  
  <pre><code>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$ 
  </code></pre>
  
  <p>This is leJOS NXJ  sample code:</p>
  
  <pre><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();
      }
  }
  </code></pre>
  
  <p>and this is related build.xml file:</p>
  
  <pre><code>&lt;project name="Example" default="uploadandrun"&gt;
      &lt;description&gt;
          org.lejos.example.HelloWorld build file
      &lt;/description&gt;
  
    &lt;!-- set properties for this build --&gt;
    &lt;property environment = "env"/&gt;
    &lt;property file="build.properties"/&gt;
    &lt;property name="src" location="src"/&gt;
    &lt;property name="build" location="build"/&gt;
    &lt;property name="program" value="Example"/&gt;
    &lt;property name="main.class" value="org.lejos.example.HelloWorld"/&gt;
    &lt;property name="binary" value="${build}/${program}.nxj" /&gt;
  
    &lt;!-- deletes generated files --&gt;
    &lt;target name="clean" description="clean up all generated files"&gt;
      &lt;delete dir="build"/&gt;
    &lt;/target&gt;
  
    &lt;target name="compile" depends="clean"
          description="compile the source " &gt;
      &lt;!-- Compile the java code from ${src} to ${build}  --&gt;
      &lt;mkdir dir="${build}"/&gt;
      &lt;javac srcdir="${src}" destdir="${build}"&gt;
        &lt;bootclasspath&gt;
          &lt;pathelement location="${nxj.classes.home}/lib/classes.jar"/&gt;
        &lt;/bootclasspath&gt;
      &lt;/javac&gt;
    &lt;/target&gt;
  
    &lt;target name="link" depends="compile"
          description="link the binary " &gt;
      &lt;!-- Link the binary and create a signature file --&gt;
      &lt;java classname="js.tinyvm.TinyVM"&gt;
        &lt;arg value="--bootclasspath"/&gt;
        &lt;arg path="${nxj.classes.jar}" /&gt;
        &lt;arg value="--classpath"/&gt;
        &lt;arg path="${build}" /&gt;
        &lt;arg value="--writeorder" /&gt;
        &lt;arg value="LE" /&gt;
        &lt;arg value="${main.class}"/&gt;
        &lt;arg value="-o"/&gt;
        &lt;arg value="${binary}"/&gt;
        &lt;arg value="-v"/&gt;
        &lt;classpath&gt;
          &lt;pathelement location="${nxj.jtools.jar}"/&gt;
          &lt;pathelement location="${nxj.commons.jar}"/&gt;
          &lt;pathelement location="${nxj.bcel.jar}"/&gt;
        &lt;/classpath&gt;
      &lt;/java&gt;
    &lt;/target&gt;
  
    &lt;target name="upload" depends="link"
          description="upload the binary" &gt;
      &lt;java classname="lejos.pc.tools.NXJUpload" fork="true"&gt;
        &lt;jvmarg value="-Djava.library.path=${nxj.library.path}"/&gt;
        &lt;jvmarg value="-Dnxj.home=${nxj.home}"/&gt;
        &lt;arg value="${binary}"/&gt;
        &lt;classpath&gt;
          &lt;pathelement location="${nxj.jtools.jar}"/&gt;
          &lt;pathelement location="${nxj.pctools.jar}"/&gt;
          &lt;pathelement location="${nxj.pccomm.jar}"/&gt;
          &lt;pathelement location="${nxj.commons.jar}"/&gt;
          &lt;pathelement location="${nxj.bcel.jar}"/&gt;
          &lt;pathelement location="${nxj.bluecove.jar}"/&gt;
          &lt;pathelement location="${nxj.bluecove-gpl.jar}"/&gt;
        &lt;/classpath&gt;
      &lt;/java&gt;
    &lt;/target&gt;
  
    &lt;target name="uploadandrun" depends="link"
          description="upload and run the binary" &gt;
      &lt;java classname="lejos.pc.tools.NXJUpload" fork="true"&gt;
        &lt;jvmarg value="-Djava.library.path=${nxj.library.path}"/&gt;
        &lt;jvmarg value="-Dnxj.home=${nxj.home}"/&gt;
        &lt;arg value="${binary}"/&gt;
        &lt;arg value="-r"/&gt;
        &lt;classpath&gt;
          &lt;pathelement location="${nxj.jtools.jar}"/&gt;
          &lt;pathelement location="${nxj.pctools.jar}"/&gt;
          &lt;pathelement location="${nxj.pccomm.jar}"/&gt;
          &lt;pathelement location="${nxj.commons.jar}"/&gt;
          &lt;pathelement location="${nxj.bcel.jar}"/&gt;
          &lt;pathelement location="${nxj.bluecove.jar}"/&gt;
          &lt;pathelement location="${nxj.bluecove-gpl.jar}"/&gt;
        &lt;/classpath&gt;
      &lt;/java&gt;
    &lt;/target&gt;
  
    &lt;!--  used only for modifying the Netbeans NXJPlugin --&gt;
      &lt;target name="Zip for Netbeans" description="Zip the application to the sample project"&gt;
          &lt;property name="build.classes.dir" location="/build"/&gt;
          &lt;property name="plugin" location="../NXJPlugin/src/nxjplugin/"/&gt;
          &lt;zip basedir="." destfile="${plugin}/NXJSampleProject.zip"&gt;
              &lt;exclude name="**/build/"/&gt;
              &lt;exclude name="**/bin/"/&gt;
              &lt;exclude name="**/dist/"/&gt;
              &lt;exclude name="**/nbproject/private/"/&gt;
          &lt;/zip&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and this is ide-file-targets.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project basedir=".." name="org.lejos.example-IDE"&gt;
      &lt;target name="run-selected-file-in-src"&gt;
          &lt;fail unless="run.class"&gt;Must set property 'run.class'&lt;/fail&gt;
          &lt;ant antfile="build.xml" target="uploadandrun"&gt;
              &lt;property name="main.class" value="${run.class}"/&gt;
          &lt;/ant&gt;
      &lt;/target&gt;
  
      &lt;target name="compile-selected-files-in-src"&gt;
          &lt;ant antfile="build.xml" target="compile"/&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>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/
  </code></pre>