{"id":4753,"date":"2014-03-30T15:06:24","date_gmt":"2014-03-30T15:06:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/runtime-exec-doesnt-do-anything-no-errors-collection-of-common-programming-errors\/"},"modified":"2014-03-30T15:06:24","modified_gmt":"2014-03-30T15:06:24","slug":"runtime-exec-doesnt-do-anything-no-errors-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/runtime-exec-doesnt-do-anything-no-errors-collection-of-common-programming-errors\/","title":{"rendered":"Runtime.exec doesn&#39;t do anything&hellip; (no errors)-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to use java to run a batch file at an absolute location. The batch file will compile a couple of java files.<\/p>\n<p>Here is the code which I have been trying:<\/p>\n<pre><code>String s=file.getAbsolutePath() + \"\\\\compile.bat\";\nRuntime rut = Runtime.getRuntime();\ntry {\n    rut.exec(new String[] {file.getAbsolutePath() + \"\\\\compile.bat\"});\n}catch(IOException e1) {\n    e1.printStackTrace();\n}\nSystem.out.println(s);\n<\/code><\/pre>\n<p>Now, when this code gets executed, I get no console errors, but the batch file is not run. When I run the batch file through Windows Explorer, however, the batch file works, compiles the files and closes when done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to use java to run a batch file at an absolute location. The batch file will compile a couple of java files. Here is the code which I have been trying: String s=file.getAbsolutePath() + &#8220;\\\\compile.bat&#8221;; Runtime rut = Runtime.getRuntime(); try { rut.exec(new String[] {file.getAbsolutePath() + &#8220;\\\\compile.bat&#8221;}); }catch(IOException e1) { e1.printStackTrace(); } System.out.println(s); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4753","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4753"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4753\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}