Here you can find the source of getRoot()
public static File getRoot()
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static File getRoot() { System.out.print("Detecting OS... "); final String name = System.getProperty("os.name").toLowerCase(); File root;//from w ww . ja v a 2 s. c o m if (name.contains("win")) root = new File(System.getenv("APPDATA") + File.separator + ".minecraft"); else if (name.contains("mac")) root = new File( System.getProperty("user.home") + File.separator + "Library/Application Support/minecraft"); else if (name.contains("nix") || name.contains("nux") || name.contains("aix")) root = new File(System.getProperty("user.home") + File.separator + ".minecraft"); else root = null; System.out.println(name); return root; } }