I'm using Elementary OS, and just found I've not jar command. I tried to install it through the typical:apt-get install jarBut this doesn't work, since jar is not found in the repositories or isn't the name of the package.I've tried to look for it in google, but jar is such a used word that I've found nothing useful.Could you say me how to install it?Thank you in advanceUpdate:$ java -versionjava version 1.8.0_40Java(TM) SE Runtime Environment (build 1.8.0_40-b25)Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode)$ javac -versionjavac 1.8.0_40
How to install jar command in Elementary OS
elementary os
jar is part of the JDK. If you installed the JDK correctly, you should have it. As far as I'm concerned, the path to jar is /usr/lib/jvm/java-7-openjdk-amd64/bin/jar. The version and architecture are the main variables.In most cases, the binary should be made available to your shell's PATH through a few symlinks. For instance, on my Ubuntu machine, jar is found at /usr/bin/jar, which is itself a symlink to /etc/alternatives/jar (another symlink). The final destination is /usr/lib/jvm/java-7-openjdk-amd64/bin/jar.It is possible that you may not have these links correctly set up (especially if you don't use the update-alternatives mechanism), which might make your shell unable to find the jar executable. The first step to solve this is to locate it. Have a look at the various paths I've given earlier, and try to locate it.Note: as a last resort, you can use the following find command to have it looked up system-wide:$ find / -type f -name jarOnce you have found it, make sure the directory in which it lies is within your PATH.For instance, let's assume you don't want to create links. If you were to add the /usr/lib/jvm/java-7-openjdk-amd64/bin directory to your PATH, you'd add the following to your ~/.bashrc file:export PATH=$PATH:/usr/lib/jvm/java-7-openjdk-amd64/binAfter re-sourcing the file, or reopening your terminal, you should be able to run jar. Now, if you don't want to use that trick, and prefer to use a symlink, you could do something like...$ sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64/bin/jar /usr/bin/jarOf course, you'd have to make sure that /usr/bin is within your PATH, or you would just end up with the same problem all over again.