Error: Could not find or load main class - .jar file execution

Error: Could not find or load main class - .jar file execution

I've been digging and digging trying everything I can to resolve this but nothing seems to be working. I just installed Intellij IDEA on my machine and created a new maven project. I am simply attempting to execute a hello world program to verify everything is setup correctly. However, something is not right.

I've been digging and digging trying everything I can to resolve this but nothing seems to be working. I just installed Intellij IDEA on my machine and created a new maven project. I am simply attempting to execute a hello world program to verify everything is setup correctly. However, something is not right.

When running the application in IDEA I receive "Hello World" as expected. However when running maven package and generating a .jar file, when I attempt to execute that .jar file I receive the following message:

C:\dev\lwjglplayground\target>java lwjgl-playground-1.0-SNAPSHOT.jar
Error: Could not find or load main class lwjgl-playground-1.0-SNAPSHOT.jar
Caused by: java.lang.ClassNotFoundException: lwjgl-playground-1.0-SNAPSHOT.jar

My first instinct was that I had botched something in my java installation (as right before installing IDEA I removed my java 8 jdk and installed jdk 11), but I verified that other .jar files which I had previously built execute as expected.

My pom.xml file is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

&lt;groupId&gt;whitwhoa&lt;/groupId&gt;
&lt;artifactId&gt;lwjgl-playground&lt;/artifactId&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;jar&lt;/packaging&gt;

&lt;properties&gt;
    &lt;start-class&gt;whitwhoa.Main&lt;/start-class&gt;
&lt;/properties&gt;

&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;version&gt;3.8.0&lt;/version&gt;
            &lt;configuration&gt;
                &lt;release&gt;11&lt;/release&gt;
                &lt;archive&gt;
                    &lt;index&gt;true&lt;/index&gt;
                    &lt;manifest&gt;
                        &lt;mainClass&gt;whitwhoa.Main&lt;/mainClass&gt;
                    &lt;/manifest&gt;
                &lt;/archive&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
            &lt;version&gt;3.1.1&lt;/version&gt;
            &lt;configuration&gt;
                &lt;archive&gt;
                    &lt;index&gt;true&lt;/index&gt;
                    &lt;manifest&gt;
                        &lt;mainClass&gt;whitwhoa.Main&lt;/mainClass&gt;
                    &lt;/manifest&gt;
                &lt;/archive&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;

</project>

This is my Main.java file:

package whitwhoa;

public class Main {

public static void main(String[] args) {
    System.out.println("Hello World");
}

}

Does anything here stick out to anyone as being misconfigured? Am I missing something?

java maven

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

What Is Maven And How It Works? | Maven Tutorial For Beginners

What Is Maven And How It Works? | Maven Tutorial For Beginners will help you understand the basics of Maven, and all the critical terms needed to have a clearer picture of this DevOps tool. Help you understand the need for Maven today and what exactly Maven does. Towards the end, we shall also see different companies that use Maven today.

How Java Became The Best Career Option for IT Jobs in 2020?

Join CETPA, India's best institute for Java online training and Certification Course. Enroll now to learn Core to Advanced Java & avail 50% discount on Java Online Course with Certificate.