title: Java jar file "no main manifest attribute"
body: <p>To start, I have looked at the similar questions posted about this topic. I have not found a solution.</p>
  <p>I wish to distribute a small project I have been working on to friends and family. Trouble is I can't expect them all to be able to run .class files. Therefore I am trying to produce a .jar file that I can turn into an .exe file. I am however running into an issue. It complains about missing the main manifest attribute. After some googling, I resolved to try a little <a href="https://introcs.cs.princeton.edu/java/85application/jar/jar.html" rel="nofollow noreferrer">tutorial</a>. I am following the tutorial (even downloading the little Hello.jar file), but still I get no main manifest attribute.</p>
  <p>As I am running Windows 10, I am using PowerShell to run commands. This is the commands I've run:</p>
  <pre><code>PS C:\testJarFraNettet&gt; javac Hello.java
  PS C:\testJarFraNettet&gt; jar cmf Hello.mf Hello.jar Hello.class Hello.java
  PS C:\testJarFraNettet&gt; java -jar Hello.jar
  no main manifest attribute, in Hello.jar
  PS C:\testJarFraNettet&gt;
  </code></pre>
  <p>You'll notice I've included the .java file in the .jar as well, just to be sure.</p>
  <p>Hello.mf contains:</p>
  <pre><code>Manifest-Version: 1.0
  Main-Class: Hello
  </code></pre>
  <p>I investigated the .jar file that gets produced. Inside, among the files specified in the command, I find the expected .\META-INF\MANIFEST.MF file with the following content:</p>
  <pre><code>Manifest-Version: 1.0
  Created-By: 17.0.1 (Eclipse Adoptium)
  </code></pre>
  <p>I've never touched Eclipse (I use VS Code), but I assume this is of no consequence.
  Per another article I found online, I edited the file to instead contain what the tutorial tells me it should contain:</p>
  <pre><code>Manifest-Version: 1.0
  Main-Class: Hello
  </code></pre>
  <p>Still no luck. I've decided against showing my own code, as it needlessly complicates troubleshooting since I get the same error anyways. I still have some hurdles left, such as how to add image files. The project is a GUI based game. But that is an issue for later, I suppose.</p>
  <p>Thank you for your time!</p>