- Java Development Kit (JDK) 21 or higher
- Git (optional, if you need to clone the project)
- Gradle (optional, as the project includes the Gradle Wrapper)
If you have access to the source code on GitHub, clone the repository:
git clone https://github.com/devops-360-online/event-management.git
cd event-managementNote: If you already have the source code on your machine, simply navigate to the project directory.
Ensure that Java 21 or higher is installed:
java -versionThe output should indicate that you're running Java 21 or a later version.
The project includes a Gradle Wrapper (gradlew), so you don't need to install Gradle separately.
Make sure the gradlew script is executable:
chmod +x gradlewBuild the project:
./gradlew buildIf you have Gradle installed on your machine, you can also use:
gradle build./gradlew bootRungradle bootRunOpen your web browser and navigate to:
http://localhost:8080/eventsYou should see a list of events in JSON format, for example:
[
{
"id": 1,
"name": "DevOps Conference",
"date": "2024-11-10"
},
{
"id": 2,
"name": "Spring Boot Workshop",
"date": "2024-12-05"
}
]If you see this output, the application is running correctly.
# Clone the project (if needed)
git clone https://github.com/your-username/event-management.git
cd event-management
# Make the Gradle Wrapper executable
chmod +x gradlew
# Build the project using the Gradle Wrapper
./gradlew build
# Run the application
./gradlew bootRun- Default Port: The application listens on port 8080. If this port is already in use, you can change the port by modifying the
src/main/resources/application.propertiesfile:
server.port=8081- Permissions: If you encounter permission issues with the
gradlewscript, ensure it is executable:
chmod +x gradlew- Java Not Found or Wrong Version: Ensure that
JAVA_HOMEpoints to the correct Java version. You can setJAVA_HOMElike this:
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))Make sure that the Java version is 21 or higher.
-
Gradle Not Found: If you're using the Gradle Wrapper, ensure that the
gradlewfile exists at the root of the project and is executable. -
Missing Dependencies: If the build fails, check your internet connection, as Gradle needs to download dependencies during the first build.
You now have all the information needed to run the application on Linux. If you have any questions or issues, feel free to ask for help.