{"id":4787,"date":"2014-03-30T15:21:47","date_gmt":"2014-03-30T15:21:47","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/java-exec-doesnt-work-in-64-bit-windows-collection-of-common-programming-errors\/"},"modified":"2014-03-30T15:21:47","modified_gmt":"2014-03-30T15:21:47","slug":"java-exec-doesnt-work-in-64-bit-windows-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/java-exec-doesnt-work-in-64-bit-windows-collection-of-common-programming-errors\/","title":{"rendered":"Java exec doesn&#39;t work in 64 bit Windows-Collection of common programming errors"},"content":{"rendered":"<p>If its works as admin, but not as normal user then it is likely a problem with the privileges.<\/p>\n<p>I strongly recommend to add some logging around the execution.<\/p>\n<p>for example<\/p>\n<pre><code>Runtime runtime = Runtime.getRuntime();\nProcess convertProcess = runtime.exec(execProperties);\n\n\/** important; read the error stream before! invoke waitFor *\/\nBufferedReader errorReader = new BufferedReader(\n    new InputStreamReader(convertProcess.getErrorStream()));\ntry {\n    StringBuilder errorMessage = new StringBuilder();\n    String line = null;\n    while ((line = errorReader.readLine()) != null) {\n         errorMessage.append(line);\n         errorMessage.append(\"\\n\");\n    }\n\n    int returnValue = convertProcess.waitFor();\n    if (returnValue != 0) {\n         handleNonZeroReturnValue(returnValue)\n    }\n} finally {\n   errorReader.close();\n}\n<\/code><\/pre>\n<p><em>I hope that helps you to &#8220;debug&#8221; the problem<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If its works as admin, but not as normal user then it is likely a problem with the privileges. I strongly recommend to add some logging around the execution. for example Runtime runtime = Runtime.getRuntime(); Process convertProcess = runtime.exec(execProperties); \/** important; read the error stream before! invoke waitFor *\/ BufferedReader errorReader = new BufferedReader( new [&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-4787","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4787","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=4787"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4787\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}