How to change the classpath and run the code in Java?
<p>I was trying to execute the following code in java:</p>

<pre><code>import java.awt.*;
import javax.swing.*;

import org.fife.ui.rtextarea.*;
import org.fife.ui.rsyntaxtextarea.*;

public class TextEditorDemo extends JFrame {

   private static final long serialVersionUID = 1L;


   public TextEditorDemo() {

      JPanel cp = new JPanel(new BorderLayout());

      RSyntaxTextArea textArea = new RSyntaxTextArea();
      textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
      RTextScrollPane sp = new RTextScrollPane(textArea);
      cp.add(sp);

      setContentPane(cp);
      setTitle("RSyntaxTextArea 1.4 - Example 1 - Text Editor Demo");
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      pack();
      setLocationRelativeTo(null);

   }

   public static void main(String[] args) {
      // Start all Swing applications on the EDT.
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            new TextEditorDemo().setVisible(true);
         }
      });
   }

}
</code></pre>

<p>Since I'm using <a href="http://fifesoft.com/rsyntaxtextarea/" rel="nofollow">RSyntaxTextArea</a> file i have to give the classpath of it while I'm running the code. 
Assume that my RSyntaxTextArea.jar file is in Anto(i.e. my Home directory in Ubuntu 10.10) and when I run the above code:</p>

<pre><code>javac -classpath \Anto\RSyntaxTextArea.jar TextEditorDemo.java
</code></pre>

<p>Still I'm getting the error as <code>RTextScrollPane</code> could not be found kind of errors. I guess i have been giving my classpath wrongly; What to do?</p>

<p>Thanks for the answer.</p>
