public static void unjar(File jarFile, File directory)
	{
		JarFile jfile;
		try
		{
			jfile = new JarFile(jarFile);

			final Enumeration<? extends JarEntry> entries = jfile.entries();

			while (entries.hasMoreElements())
			{
				final JarEntry entry = entries.nextElement();
				final File file = new File(directory, entry.getName());
				if (entry.isDirectory())
				{
					file.mkdirs();
				}
				else
				{
					file.getParentFile().mkdirs();
					final InputStream in = jfile.getInputStream(entry);
					try
					{
						copy(in, file);
					}
					finally
					{
						in.close();
					}
				}
			}
		}
		catch (final IOException e)
		{
			e.printStackTrace();
		}
	}