So I've looked up many tutorials on how to compile code. I've tried to follow all of them. But I keep getting that error. Here's my code:
package ytho;
public class a {
public static void main(String[] args){
System.out.println("ytho");
}
}
And here's what I put for my manifest.txt:
Main-Class: a
I've also tried putting it as Main-Class: .a
and Main-Class: ytho.a
, to no avail.
I'm sorry that this is a duplicate, but all other tutorials on here haven't worked for me. So, I decided to finally ask myself. Help would be greatly appreciated. And if you need more information, let me know, but I may be late to reply.
Lets do it step my step:
a
class to A
since java uses Capitals on the first letter (this is stylistic)javac ytho/A.java
jar cvfm MyJarName.jar MANIFEST.MF *
Here is what my directory looks like
.
├── MANIFEST.MF
├── MyJarName.jar
└── ytho
├── A.class
└── A.java
Here is the content of the Manifest
Main-Class: ytho.A
And run it like so:
$: java -jar MyJarName.jar
which print out
ytho