Re: JDK/JRE and older Java versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Peter,

I understand you don't have much experience with Docker, and you totally
don't have to use it, especially if you don't plan to use it for more
advanced purposes, such as actual deployment of your production envs.

You could just download the binary archives with the JDK and JRE versions
you need, and switch between them by changing the PATH and JAVA_HOME
variables. In other words, you don't need to have them installed by
pacman, if you don't intend to use them for other software you're
using (e.g. if you are using an IDE written in Java, such as IntelliJ,
you probably don't want to use any of your "test" JREs to run it).

Using Docker for the same purpose is not much more difficult than
selecting which of the Java installations to use with env variables.
E.g. to compile a simple one-file program, the command would be:

$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openjdk:11 javac Main.java

(which I took from the openjdk documentation[1]).

Of course, your project probably uses a build system of some kind,
so it will take some effort to set up. Whether or not it will pay
off for you I cannot say. However, consider other practical benefits
too: for example, if your coworker needs to reproduce an issue you're
having, you can just send them the docker command you're using, and it
will replicate your exact build environment.

Best regards,
--
Edward

[1] https://hub.docker.com/_/openjdk

Attachment: publickey - edward.toroshchyn@pm.me - 0xEDCD8534.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux