Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looks like you're missing the first backslash in the path to your jar:</p> <pre><code>String command = "java " + "-jar " + "\"g:My Documents\\Dropbox\\Final Project\\Code\\Mano CPU\\Inputs\\Parser\\java-cup-11a.jar\" " + </code></pre> <p>should be</p> <pre><code>String command = "java " + "-jar " + "\"g:\\My Documents\\Dropbox\\Final Project\\Code\\Mano CPU\\Inputs\\Parser\\java-cup-11a.jar\" " + ^^ </code></pre> <hr> <p><strong>Edit:</strong> millimoose pointed out that <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec%28java.lang.String%29" rel="nofollow"><code>Runtime#exec(String)</code></a> doesn't use the shell to invoke, so I checked the documentation and it apparently just uses a <a href="http://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html" rel="nofollow"><code>StringTokenizer</code></a> to <em>split on spaces</em>. Java is gonna split your command arguments even though they're wrapped in double-quotes. So in addition to fixing the backslash issue above, you're going to need to use the form of <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec%28java.lang.String%5B%5D%29" rel="nofollow"><code>exec</code></a> which accepts a <code>String[]</code>. And you won't need to double-quote arguments containing spaces.</p> <pre><code>String[] command = new String[] { "java", "-jar", "g:\\My Documents\\Dropbox\\Final Project\\Code\\Mano CPU\\Inputs\\Parser\\java-cup-11a.jar", "-destdir", "g:\\My Documents\\Dropbox\\Final Project\\Code\\Mano CPU\\src\\Assembler", "G:\\My Documents\\Dropbox\\Final Project\\Code\\Mano CPU\\Inputs\\Assembler\\Assembler.cup", }; Process p = Runtime.getRuntime().exec(command); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload