![]() ![]() Java is one of the preferred languages by many developers but it is also necessary to run other very important software. Besides this, it is also the basis for the installation of many other applications. This post can be the basis for you to get into this programming language. In this post, you will learn quickly and easily how to install Java on Debian 11. Many important tools are created in this language. Old rockers never die and that’s why languages like Java don’t either. Now we create a new file named HelloWorld.Taskset Cheatsheet | Pandoc Cheatsheet | Curl Cheatsheet | Grep CheatSheet | Cron CheatSheet | Grep CheatSheet | More! To validate the functionality of your Java installation, let’s run a simple “Hello World” program. The output should display the Java version you installed, indicating a successful installation. To confirm that Java is installed correctly, check the installed Java version by executing the command: java -version To apply the modifications, run: source ~/.bashrc Save the changes and exit the text editor. Open the bash configuration file using the command: nano ~/.bashrcĪdd the following lines at the end of the file: export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 To ensure the proper execution of Java applications, it is essential to set up the necessary environment variables. Execute the following commands to install OpenJDK: OpenJDK, an open-source alternative to Oracle JDK, is recommended for its compatibility and security. Sudo apt-key adv -keyserver -recv-keys 8B48AD6246925553 Now import the repository’s key, and run: sudo sh -c 'echo "deb $(lsb_release -sc) main contrib non-free" > /etc/apt//debian.list' Execute the following commands in your terminal: sudo apt install curl dirmngr gnupg To benefit from a well-maintained Java installation, it is recommended to add the official Debian repository. This command will refresh the repository, allowing you to install the latest versions of software packages. Sudo apt install apt-transport-https lsb-release ca-certificates curl dirmngr gnupg Before we install any software, it’s important to make sure your system is up to date by running the following apt commands in the terminal: sudo apt update We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root. A non-root sudo useror access to the root user.You’ll need an internet connection to download the necessary packages and dependencies for Java. SSH access to the server (or just open Terminal if you’re on a desktop). ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |