import java.io.*;
import java.util.Scanner;

public class jbin
{
	public static void jarToBinary(String jar, String binary) throws IOException
	{
		try {
			File binaryFile = new File(binary);

			// Deletes file if exists.
			binaryFile.delete();

			// Creates blank file.
			binaryFile.createNewFile();
		} catch (FileNotFoundException e) {

		} catch (IOException e) {
			System.out.println("Error reading file '" + binary + "'.");
		}

		// Creates executable binary.
		try {
			byte[] buffer = new byte[(int) (new File(jar)).length()];

			FileInputStream shebangInputStream = new FileInputStream("shebang.txt");
			FileInputStream jarInputStream = new FileInputStream(jar);

			int shebangRead = 0;
			int jarRead = 0;

			while((jarRead = jarInputStream.read(buffer)) != -1 && (shebangRead = shebangInputStream.read(buffer)) != -1) {
				FileOutputStream outputStream = new FileOutputStream(binary);

        outputStream.write(buffer);
        outputStream.close();
			}

			shebangInputStream.close();
			jarInputStream.close();
		} catch (FileNotFoundException e) {
			System.out.println("Unable to open file '" + jar + "'.");
		} catch (IOException e) {
			System.out.println("Error reading file '" + jar + "'.");
		}

		// Allow execution.
		try {
			File binaryFile = new File(binary);

			binaryFile.setExecutable(true);
		} catch (SecurityException e) { // If permissions are not sufficient.
			System.out.println("Unable to set '" + binary + "' to executable.");
			System.out.println("Do this manually with: chmod +x " + binary);
		}
	}

	public static void sourceToJAR(String main, String[] additional, String jar) throws IOException, InterruptedException
	{
		// Create JAR...

		// Create META-INF/MANIFEST.MF if it doesn't exist.
		try {
			File manifest = new File("META-INF/MANIFEST.MF");

			// Ensure META-INF directory exists.
			manifest.getParentFile().mkdirs();

			if (!manifest.exists()) { // If it doesn't exist...
				manifest.createNewFile(); // ...create it.

				OutputStream manifestOutput = new FileOutputStream(manifest);
				String manifestContent = "Main-Class: " + main.substring(0, main.length() - 5);

				manifestOutput.write(manifestContent.getBytes());
				manifestOutput.flush();
				manifestOutput.close();
			}
		} catch (IOException e) {
			System.out.println("Could not create manifest file for JAR.");
			System.out.println(e.getMessage());
		}

		// Compile everything.
		try {
			Process compileSource = Runtime.getRuntime().exec("javac " + main); // TODO: compile additional files.
			compileSource.waitFor();
		} catch (InterruptedException e) {
			System.out.println("Could not compile Java source.");
		}
	}

	public static void main(String[] args) throws IOException, InterruptedException {
		jbin.sourceToJAR(args[0], new String[0], args[1]);
	}
}

@@ -2653,24 +2653,306 @@
 urce.%22);%0A%09%09%7D
+%0A%0A%09%09// Create JAR...%0A%09%09try %7B%0A%09%09%09Process createJAR = Runtime.getRuntime().exec(%22jar cmvf META-INF/MANIFEST.JAR %22 + jar + main.substring(0, main.length() - 5) + %22.class%22);%0A%09%09%09createJAR.waitFor();%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09System.out.println(%22Could not create JAR.%22);%0A%09%09%7D
 %0A%09%7D%0A%0A%09public

Create JAR from compiled Java source.