Advertisement
swimauger

Run Minecraft Client in IDE

Mar 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public static void main(String[] args) {
  2.   String line;
  3.   Process p;
  4.   String os = System.getProperty("os.name");
  5.   try {
  6.     if(os.equalsIgnoreCase("win")) {
  7.       p = Runtime.getRuntime().exec("gradlew runClient");
  8.     } else {
  9.       p = Runtime.getRuntime().exec("./gradlew runClient");
  10.     }
  11.     BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
  12.     while ((line = input.readLine()) != null) {
  13.       System.out.println(line);
  14.     }
  15.     input.close();
  16.   } catch (IOException e) {
  17.       e.printStackTrace();
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement