diff --git a/app/src/main/java/com/duy/compile/external/java/Jar.java b/app/src/main/java/com/duy/compile/external/java/Jar.java index 10c6e00aa..c74d76c4a 100644 --- a/app/src/main/java/com/duy/compile/external/java/Jar.java +++ b/app/src/main/java/com/duy/compile/external/java/Jar.java @@ -57,8 +57,13 @@ public static void createJarArchive(JavaProjectFolder projectFolder) throws IOEx // Open archive file FileOutputStream stream = new FileOutputStream(archiveFile); + Manifest manifest = new Manifest(); - manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); + File manifestFile = new File(projectFolder, "MANIFEST.MF"); + if(manifestFile.exists()){ + FileInputStream manifestStream = new FileInputStream(manifestFile); + manifest.read(manifestStream); + } else manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); //Create the jar file JarOutputStream out = new JarOutputStream(stream, manifest);