Windows: download JAR ⬇️
java -jar lc32.jarLinux: download DEB ⬇️
sudo dpkg -i lc32.deblc32- Java Development Kit (JDK) installed
- A Java project with
.javasource files
javac -d out src/*.javaTo specify the entry point, create a manifest.txt file inside the out/ directory with the following content:
Main-Class: Main
Note: Ensure there is an empty newline at the end of the file to avoid errors.
jar cfm lc32.jar manifest.txt -C out .java -jar lc32.jarIf you want to run the program without packaging it into a JAR file, use:
java -cp out Main- A compiled
chat.jarfile - A Linux system with
dpkginstalled
mkdir -p lc32-deb/DEBIAN
mkdir -p lc32-deb/usr/bin
mkdir -p lc32-deb/usr/share/lc32cp chat.jar lc32-deb/usr/share/lc32/touch lc32-deb/usr/bin/lc32
chmod +x lc32-deb/usr/bin/lc32#!/bin/bash
java -jar /usr/share/lc32/chat.jarnano lc32-deb/DEBIAN/controlAdd the following content:
Package: lc32
Version: 1.0
Architecture: all
Maintainer: Your Name <your.email@example.com>
Depends: default-jre
Description: A simple LAN chat application
chmod 755 lc32-deb/usr/bin/lc32
chmod 755 lc32-deb/DEBIANdpkg-deb --build lc32-debsudo dpkg -i lc32-deb.debIf you encounter dependency issues, fix them by running:
sudo apt --fix-broken installlc32