So I want to open cmd though java with this code
import java.io.IOException;
public class mainer {
public static void main(String args[]) {
try {
Runtime.getRuntime().exec("cmd.exe /c start");
System.out.println("ok");
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
but I get this error when I execute it
java.io.IOException: Cannot run program "cmd.exe": CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at mainer.main(mainer.java:6)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more
and the funny thing is that it worked 2 days ago and now it gives me this strange error