Compilation error while sending JAR file to SPOJ

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 
+4
source share
1 answer

Try sending the solution through the Java option (Hotspot 8u) instead of the JAR option (JavaSE6). It worked in my case!

In any case, you should first try your solution Ideone to make sure that it works fine, and then send it to judge SPOJ

0
source

All Articles