- 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-management
Note: 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 -version
The 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 gradlew
Build the project:
./gradlew build
If you have Gradle installed on your machine, you can also use:
gradle build
./gradlew bootRun
gradle bootRun
Open your web browser and navigate to:
http://localhost:8080/events
You 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.properties
file:
server.port=8081
- Permissions: If you encounter permission issues with the
gradlew
script, ensure it is executable:
chmod +x gradlew
- Java Not Found or Wrong Version: Ensure that
JAVA_HOME
points to the correct Java version. You can setJAVA_HOME
like 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
gradlew
file 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.