title: Java Classpath Error When compiling a java project from another java program
body: <h2>I am getting a class-path error on Ubuntu v20.04 which says</h2>
  <pre><code>error: invalid flag: Edition/lib/jfontchooser-1.0.5.jar&quot;;.
  Usage: javac &lt;options&gt; &lt;source files&gt;
  use --help for a list of possible options
  </code></pre>
  <p>Actually, I am creating a java IDE and whenever a project having some dependecy is made to compile or execute the above error is raised up and the process executing the command exists.
  The compilation of the project is done by creating a process as:</p>
  <pre><code>String pathToCompiler = &quot;/usr/lib/jvm/java-11-openjdk-amd64/bin/javac&quot;;
  String depenPath = &quot;/home/arham/Documents/Eclipse Workspace/Omega IDE Linux Edition/lib/jfontchooser-1.0.5.jar&quot;;
  Process compile = Runtime.getRuntime().exec(pathToCompiler+&quot; -d bin -classpath \&quot;&quot;+depenPath+&quot;\&quot;;. @.sources&quot;, null, new File(&quot;Project Path&quot;))
  </code></pre>
  <p>It is giving the same error either by creating the process from <code>Runtime</code> or by <code>ProcessBuilder</code>
  <a href="https://i.stack.imgur.com/tpoVo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tpoVo.png" alt="Here's a screenshot of the error in my IDE" /></a></p>
  <h2>The overall command that the <code>compile</code> process is executing is</h2>
  <pre><code>/usr/lib/jvm/java-11-openjdk-amd64/bin/javac -d bin -classpath &quot;/home/arham/Documents/Eclipse Workspace/Omega IDE Linux Edition/lib/jfontchooser-1.0.5.jar&quot;;. @.sources 
  </code></pre>
  <p>The above command works fine on <strong>Windows 10 Pro v2004</strong> but not on <strong>Ubuntu v20.04 LTS</strong>.</p>
  <ul>
  <li>When I run the above command directly on the terminal it gave <strong>no error</strong> but when with a <code>java.lang.Process</code> it gives an <strong>error</strong> (mentioned in the starting).
  <strong>I have tried removing the <strong>extra quotes</strong> and by removing <code>;.</code> from the <em>classpath</em> in many combinations but it didn't worked.</strong></li>
  </ul>