Createprocess Command.com /c Set Error=2
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Java.io.ioexception Createprocess Error=2
this site About Us Learn more about Stack Overflow the company Business Learn createprocess error 2 c++ more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Windows Createprocess Error 2
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting java.io.IOException: CreateProcess: c:\Windows\System32\My_exe 1 error=2 up vote 0 down vote favorite I am getting java.io.IOException: CreateProcess: c:\Windows\System32\My_exe 1 error=2 when I am trying to run my app which needs to execute My_exe.exe. I am running my app in Wepshere 6.1 server and OS is Windows 7 64 bit and the editor is RAD 7.5.4. The PATH is set to C:\Windows\System32. When I run it from dos prompt - no errors. Same app runs good on Windows XP. Any help would be appreciated. java windows-7 windows-xp createprocess runtime.exec share|improve this question edited Dec 15 '11 at 21:14 Bhesh Gurung 32.8k1563102 asked Dec 15 '11 at 21:06 SMG 12 Can you print the full stack trace, or that's all you get? –Sid Malani Dec 15 '11 at 22:12 error=2 means that the file is not found. Show the real code and the complete stacktrace. –RealHowTo Dec 15 '11 at 22:20 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote You don't say what you are doing to run your application, but if you're using Runtime.exec you need to reference "My_exe.exe", not just "My_exe". share|improve this answer answered Dec 15 '11 at 21:21 TimK 2,3561019 thanks for your reply but its My_exe.exe sorry about the typo.And yes I am using Runtime.exec –SMG Dec 15 '11 at 21:52 Can you add your code to the question? –TimK Dec 15 '11 at 22:38 Here is the stacktrace I'm getting :java.io.IOException: CreateProcess:
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or http://stackoverflow.com/questions/8526576/getting-java-io-ioexception-createprocess-c-windows-system32-my-exe-1-error-2 posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes http://stackoverflow.com/questions/9249593/maven-1-0-2-and-jdk-1-6-issue a minute: Sign up Maven 1.0.2 and JDK 1.6 issue up vote 1 down vote favorite I'm working with Maven 1.0.2 and JDK 1.5 for some time without any problems. I decided to migrate to JDK 1.6 so I've changed the JAVA_HOME enviroment variable (on Windows 7 system) and now I receive a strange error message when trying to use maven (maven install command in cmd, for example). java.io.IOException: Cannot run program "command.com": CreateProcess error=2, the system could not find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang.Runtime.exec(Runtime.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exec ute.java:646) at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:416) at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:427) at org.apache.tools.ant.taskdefs.Execute.getProcEnvironment(Execute.java :180) at org.apache.tools.ant.taskdefs.Property.loadEnvironment(Property.java: 455) at org.apache.tools.ant.taskdefs.Property.execute(Property.java:359) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:185) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279) at org.apache
New Topic programming forums Java Java JSRs Mobile Certification https://coderanch.com/t/438445/java/java/java-io-IOException-CreateProcess-error Databases Caching Books Engineering Languages Frameworks Products This Site https://support.microsoft.com/en-us/kb/175986 Careers Other all forums Forum: Java in General java.io.IOException: CreateProcess: error=2 Dilanka Muthukumarana Greenhorn Posts: 11 posted 7 years ago hey all.. I tried to run java code to access shut.bat file to shutdown remote createprocess error computer.so I use batch commands.but result is the following exception.. "java.io.IOException: CreateProcess: shut.bat 127.0.0.1 Dilanka keepintouch error=2" in this file username is dilanka and password is keepintouch.. this is ma code sample: I have already included "shut.bat" , psshutdown.exe and shut.class files in the suitable createprocess error 2 folder.. please help me to run this program. shut.bat file psshutdown.exe -k -u %2 -p %3 -t 5 \\%1 shut.java public synchronized void run(){ boolean temp=false; System.out.println("shut run " +"shut.bat "+this.IPaddr+" "+this.User+" "+this.Passwd); try{ p = Runtime.getRuntime().exec("shut.bat "+this.IPaddr+" "+this.User+" "+this.Passwd); // newly added##### //String cmd = "shut.bat"+this.IPaddr+" "+this.User+" "+this.Passwd; //p = Runtime.getRuntime().exec(cmd); // ########### System.out.println(p); System.out.println("Shutdown is in progress "); in = new BufferedReader(new InputStreamReader(p.getErrorStream())); line=null; while ((line = in.readLine()) != null){ //System.out.println(this.IPaddr+line); if(!temp) //mw.updateMsg(this.IPaddr+" --- > "+"Connecting ....."); System.out.println(this.IPaddr+" --- > "+"Connecting ....."); if(line.equals("Sysinternals - www.sysinternals.com")) temp=true; if((temp==true) && (!line.equals("")) && !line.equals("Sysinternals - www.sysinternals.com")) //mw.updateMsg(this.IPaddr+" --- > "+line); System.out.println(this.IPaddr+" --- > "+line); } }catch(IOException io){ System.out.println(io); } } Steve Luke Bartender Posts: 4181 22 I like... posted 7 years ago The rest of the error message for that "error=2" error is "No
360 games PC games Windows games Windows phone games Entertainment All Entertainment Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft