如何运行外部Java文件,有三种方式。
首先先写一个java文件到c盘中:
public class Demo {
public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
String str = "public class Hello { public static void main(String[] args) {System.out.println(\"hello!\");}}";
File myDir = new File("C:\\Users\\whatsoooever\\Desktop\\hello");
myDir.mkdir();
File file = new File(