This guide will help you build and run a Java Swing application using Maven on macOS.
- Java Development Kit (JDK) 8 or higher
- Maven 3.6 or higher
- macOS operating system
-
Install Java Development Kit (JDK) Open the Terminal app and run the following command to install the JDK:
brew install openjdk@8
-
Install Maven Run the following command to install Maven:
brew install maven
-
Create a new Project
mvn archetype:generate -DgroupId=com.personal -DartifactId=mvc-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
-
Navigate to the Project Directory
cd mvc-app
-
Compile the Application
mvn clean package
-
Run the Application
mvn exec:java -Dexec.mainClass="com.personal.App"