Install Debian Packages On Centos 5 Eol
Install Debian Packages On Centos 5 Iso![]() ![]() How to Install Java 8 on Debian GNU/Linux 9 (Stretch)In this article, I will go through the process of installation of Java 8 on Debian 9 Stretch. Java comes in two flavors and we install both. Open. JDK is open source version that is compatible with most software. And Oracle Java. SE is the proprietary version that should be used if your java application is incompatible with Open. JDK. There is also a neat mechanism for switching default Java in case you have both of them installed. In one of our earlier article we have explained java installation on rpm based system and this time we will have on Debian. Installing Open. JDKWe will start from installing the Open. JDK. There are two packages that we can install, a JRE and JDK. Those familiar with Java already know what this means, but for other lets mention what it means. JRE means Java Runtime Environment and JDK means Java Development Kit. So the first one is used if you are going only to start Java program, while JDK packs a javac compiler. Meaning if you are developer, you need JDK, otherwise JRE is ok. To install JRE use this command after getting root access with su: apt- get install default- jre. Depending on what kind of Debian install you did (CD, DVD, USB drive), this might or might not be already installed. On the other hand, JDK is most probably not installed. To install it, type: apt- get install default- jdk. And you are set to go. Installing Oracle Java. To install Oracle java we can use Webupd repository that is made for Ubuntu, but it also works for Debian. To add repository you first need to add add- apt- repository command if it is not installed (and that depends upon install options you selected). After installing this, we can add repositoryadd- apt- repository "deb http: //ppa. Repository is still not ready to use, we need to add key, we will see what key is missing after we run update commandapt update. Next we add key: apt- key adv - -keyserver keyserver. C2. 51. 82. 48. EEA1. How to install pip on CentOS / RHEL / Ubuntu / Debian.pip is package installer for python based packages. And now we can install Oracle Java 8apt- get install oracle- java. This will start install process, it will download newest Java 8 from Oracle site and install it. You will also get prompted by ncurses environment to accept the Oracle EULA for Java. After it is done, you can run following command to see which exact version you have installedjava - version. Should get output similar to thisjava version "1. Java(TM) SE Runtime Environment (build 1. Java Hot. Spot(TM) 6. Bit Server VM (build 2. If we need Java 9 (development version as of time of writing) or Java 7 or 6 (legacy versions), we can install those as well. We need to re- run above command, except we will change number 8 for 6, 7 or 9. Managing which Java will be using by default. Of you installed Oracle Java 6, 7, 8 and 9, plus Open. JDK, then you have 5 java installations. If you are developing for the legacy environment, you would want to set your system to use only one Java version, and to do that you dont need to remove all other java versions. Instead, you need to use following command: update- alternatives - -config java. It will give you output similar to this. Here you only need to enter the number that is shown before Java entry that you want to use as default. The asterisk signifies which one is used currently. After you changed the java alternative, the java - version command should give you different output. You could also select default java compiler with following commandupdate- alternatives - -config javac. Any other tool like javaws can be also set simply by changing last word in this command to appropriate tool name. Setting the Environment Variable. If you are using some Java Application server like JBoss or Tomcat, then you will need $JAVA_HOME variable set. To set it use above update- alternatives - -config java command to see where java is installed. Then edit following file in nanonano /etc/environment. If you just installed Java, file is empty, so add some line like this. JAVA_HOME="/usr/lib/jvm/java- 8- openjdk- amd. That is if you want Open. JDK to be your $JAVA_HOME. Save file and run source command to load new variablesource /etc/environment. Now check if it worksecho $JAVA_HOMEit should give you output like this to this/usr/lib/jvm/java- 8- openjdk- amd. That means that environment variable has been successfully set. Conclusion. We have successfully installed Open. JDK and Oracle Java SE and now have the environment set up so you can on top of it install some Java EE application servers like Red Hat JBoss, Oracle Web. Logic, Wild. Fly or Apache Tomcat. On top of that you can develop and deploy your application. Or you simply want to have plain Java SE desktop applications on your Debian 9 desktop. Either way, now you can do it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |