I am sending a JAR file for the TEST problem in SPOJ, but I get a compilation error.
2 /bin/bash: line 5: mkdir: command not found /bin/bash: line 6: META-INF/MANIFEST.MF: No such file or directory /bin/bash: line 7: META-INF/MANIFEST.MF: No such file or directory /bin/bash: line 8: META-INF/MANIFEST.MF: No such file or directory zip warning: name not matched: META-INF zip error: Nothing to do! (try: zip -r tested.zip . -i META-INF)
The contents of my JAR file already contain the META-INF / MANIFEST.MF file, so I do not understand the compilation error.
$ jar tf Main.jar META-INF/ META-INF/MANIFEST.MF Main.class
Below is the JAVA code that I used to create the JAR file.
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main (String[] args) throws Exception { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); String s; while (!(s=r.readLine()).startsWith("42")) System.out.println(s); } }
Any help in resolving the compilation error would be appreciated.
Edit: I create a jar using the java archive tool.
jar -cfm Main.jar manifest Main.class
where the manifest contains
Main-Class: Main
source share