DS Log
In my blog, I delve into the world of programming web technologies, Linux, Unix-like, and graphic design using free tools on Linux.
KINGCODE
KingCode Editor (ex Texty Editor) is my project developed using Java Swing. Project is still in development and in beta version. I plan to add additional features focused for PYTHON, PHP, JAVA, C, JS and BASH.
Read more ↗
VUE on Linux
In this guide, I'll walk you through the step-by-step process of setting up Vue.js on your Linux system, empowering you to create dynamic and interactive web applications. Let's harness the power of Vue.js together on the Linux platform!
Read more ↗
Symfony PHP
Dive into the world of Symfony PHP with this comprehensive introduction. In this guide, you'll learn the essential steps to create and manage posts and users, empowering you to build dynamic web applications with ease.
Read more ↗
Trying Linux from Windows
How to set up a PHP development server on Ubuntu 22.04
Text editors
List of text editors for developers.
Read more ↗
Fonts
Important fonts everyone needs to know.
Read more ↗
Try Linux from Windows
Here are some quick videos I made showing how to try out Linux Mint on Windows.
Read more ↗
Friday, June 21, 2024
How to set up a Java project on Linux?
Gradle
Gradle is a powerful and flexible build automation tool primarily used in software development to manage and automate the build processes of projects. It is often used for building, testing, and distributing software applications and libraries. Gradle is designed to handle projects of various sizes and complexities and is particularly well-suited for large-scale and multi-module projects.
Let's install the Java package:
sudo apt install default-jdk -y
Test installation:
java --version
Let's download Gradle package:
wget -c https://services.gradle.org/distributions/gradle-8.3-bin.zip -P /tmp
...and unzip into /opt directory:
sudo unzip -d /opt/gradle /tmp/gradle-8.3-bin.zip
We must setup ENV:
sudo nano /etc/profile.d/gradle.sh
sudo chmod +x /etc/profile.d/gradle.sh
Where we add into file:
export GRADLE_HOME=/opt/gradle/gradle-8.3
export PATH=${GRADLE_HOME}/bin:${PATH}
WE MUST RESTART SYSTEM!
Project
Let's prepare project:
mkdir mojProjekt
cd ./mojProjekt
gradle init
The command gradle init is used to initialize (set up) a new project or module in Gradle. This command helps create the basic structure of the project, including configuration files and other resources needed for building and managing the project.
Okay, now we can see whole structre with "tree" command:
We open "App.java" in text editor:
Project is compiled with:
gradle build
And finally, run:
gradle run
Happy coding!
Labels: java, linux