private static String generateJar(File folder) throws IOException {
		// Setup default tmp before anything else
		if(temporaryFolder.equals("default")) {
			if (System.getProperty("os.name").startsWith("Windows")) {
				temporaryFolder = "C:/";
			} else {
				temporaryFolder = "/tmp";
			}
		}

		// Test content
		if(userFolder != null) {
			temporaryFolder = userFolder;
		}

		String output = temporaryFolder + "doc.jar";

		ProcessBuilder jar = new ProcessBuilder("jar", "cf", output, ".");
		jar.directory(folder);
		Process process = jar.start();

		InputStream is = process.getErrorStream();
		InputStreamReader isr = new InputStreamReader(is);
		BufferedReader br = new BufferedReader(isr);
		String line;

		while ((line = br.readLine()) != null) {
		  System.out.println(line);
		}

		return output;
	}