title: Using Notepad++ to compile Java code
body: <p>I've been trying to set up Notepad++ as a little Java environment, mainly for learning Java as I was having some difficulty getting a simple program to work with NetBeans, unfortunately all the advice on setting up Notepad++ to call the Java code is not working.</p>
  
  <p>I guess notepad++ has changed or the Java development Kit has been massively modified because all examples I have used result in errors, even though there is little room for error.</p>
  
  <p>to begin I found this site:
  <a href="http://blog.sanaulla.info/2008/07/25/using-notepad-to-compile-and-run-java-programs/" rel="noreferrer">http://blog.sanaulla.info/2008/07/25/using-notepad-to-compile-and-run-java-programs/</a></p>
  
  <p>this is the code to run Javac to compile the code:</p>
  
  <pre><code>javac “$(FILE_NAME)”
  </code></pre>
  
  <p>and</p>
  
  <pre><code>java “$(NAME_PART)”
  </code></pre>
  
  <p>to run the resulted byte code, however this has absolutely no success at all anymore. Java is properly setup and I can call the Java program to do its thing through CMD.</p>
  
  <p>Using a plugin called npp and called through F6 and run with this code (given in the comments) succeeds in compiling the Java program into the correct .class file, however the command failed in running the program</p>
  
  <pre><code>cd “$(CURRENT_DIRECTORY)”
  javac $(FILE_NAME)
  java $(NAME_PART)
  </code></pre>
  
  <p>errors from the console in Notepad++ are:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: first
  Caused by: java.lang.ClassNotFoundException: first
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
  Could not find the main class: first.  Program will exit.
  Exception in thread "main"
  </code></pre>
  
  <p>I figured setting up Notepad++ to compile and run the code would be easy and fun, but its seems all documentation on the internet is outdated as nothing works.</p>
  
  <p>I would like a easy way to compile and run Java code from within Notepad++</p>
  
  <p>I could just used CMD but i'd rather it be more integrated into notepad++</p>
  
  <p>Thanks for any possible help. cheers :)</p>
  
  <p>EDIT: I'm using the latest version of Java, notepad++ and have Windows 7</p>
  
  <p>EDIT 2: the code:</p>
  
  <pre><code> //A Very Simple Example
   class ExampleProgram {
  
     public static void main(String[] args){
  
          System.out.println("I'm a Simple Program");
     }
   }
  </code></pre>