I want to execute a .exe file i made from C code :
#include <stdio.h>
#include <stdlib.h>
void helloFromC(){
printf("Hello from C!");
}
int main(){
helloFromC();
return 0;
}
Currently this is what i am trying but it gives me Error: Could not find or load main class Test
(which is the class i am currently using in Java):
import java.io.IOException;
public class Test {
public static void main(String[] args) {
try {
String filename = "D:\\eclipse\\workspace\\Testing\\TestFile.exe";
Runtime rTime = Runtime.getRuntime();
Process p = rTime.exec(filename);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}