For the JRE, something like this should do the trick:
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
Related Posts:
- How to remove the “installed manually” flag and revert to “automatically installed” with apt-get?
- How do I get apt-get to ignore some dependencies?
- list all packages from a repository in ubuntu / debian
- Best location to keep SSL certificates and private keys on Ubuntu servers?
- ping: google.com: Temporary failure in name resolution [closed]
- Docker System has not been booted with systemd as init system
- CentOS vs. Ubuntu [closed]
- Docker error : no space left on device
- How to establish ssh key pair when “Host key verification failed”
- localhost/phpinfo.php
- Ubuntu: OpenJDK 8 – Unable to locate package
- After installing with pip, “jupyter: command not found”
- gpg: no valid OpenPGP data found
- Error: A JNI error has occurred, please check your installation and try again – during running Java program from Ubuntu terminal
- Uncompress tar.gz file
- gpg: no valid OpenPGP data found
- E: Unable to locate package mongodb-org
- How to open the terminal in Atom?
- How to fix “unsupported class file major version 60” in IntelliJ?
- Valgrind permission denied on file
- nginx – nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- How to use the command update-alternatives –config java
- How to install Boost on Ubuntu
- How to verify if nginx is running or not?
- “Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar” when starting the Scala interpreter
- How to change already compiled .class file without decompile?
- Error: Could not find or load main class net.minecraft.launchwrapper.Launch when launching Minecraft 1.12.2 with Forge
- pdflatex not found. pdflatex is needed for pdf output
- Nginx: stat() failed (13: permission denied)
- PIP Could not find any downloads that satisfy the requirement SQLAlchemy
- MySQL: How to reset or change the MySQL root password?
- Removing all installed OpenCV libs
- Vim: No write since last change, even though I changed the file
- Why can’t I print to terminal with my python script?
- How to specify filepath in java?
- How to kill a process on a port on ubuntu
- whats the meaning of curl “-s” and “-m”
- How do I ask apt-get to skip any interactive post-install configuration steps?
- How to view all ssl certificates in a bundle?
- How do I auto-start docker containers at system boot?
- How do I reattach to Ubuntu Server’s ‘do-release-upgrade’ process?
- How to start/stop iptables on Ubuntu?
- Which ports do I need to open in the firewall to use NFS?
- dpkg-reconfigure: unable to re-open stdin: No file or directory
- How can I edit the welcome message when ssh start?
- How does Ubuntu keep track of the “System restart required” flag in motd?
- Amazon Linux vs. Ubuntu for Amazon EC2 [closed]
- Automate the installation of postfix on Ubuntu
- What is the debian-sys-maint MySQL user (and more)?
- How should an IT department choose a standard Linux distribution?
- Why is ssh agent forwarding not working?
- What does Java option -Xmx stand for? [duplicate]
- How do I convert a String to an int in Java?
- What does Java option -Xmx stand for? [duplicate]
- Is there an invisible character that is not regarded as whitespace?
- Problem with gif with transparent background
- Finding white rectangle in an image
- 1000 * 60 * 60 * 24 * 30 results in a negative number [duplicate]
- How to convert nanoseconds to seconds using the TimeUnit enum?
- Search for words with telephone numbers from 2-3-4 tree
- Using or ‘|’ in regex [duplicate]
- How to format strings in Java
- What is the difference between x86 and x64
- && (AND) and || (OR) in IF statements
- How to use the toString method in Java?
- What is a NullPointerException, and how do I fix it?
- What exactly is Apache Camel?
- Unable to find valid certification path to requested target – error even after cert imported
- Unable to find valid certification path to requested target – error even after cert imported
- What is the equivalent of the C++ Pair
in Java? - Java – Convert integer to string [duplicate]
- Getting random numbers in Java [duplicate]
- What is an instance variable in Java?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Java: “error: cannot find symbol”
- How does the Java ‘for each’ loop work?
- Which is the difference between Long.valueOf(0) and 0L in Java?
- What is a StackOverflowError?
- What are the differences between a HashMap and a Hashtable in Java?
- Use of “instanceof” in Java [duplicate]
- How to use Collections.sort() in Java?
- How to uninstall Eclipse?
- Is GNU’s Java Compiler (GCJ) dead? [closed]
- How does System.out.print() work?
- How do I “decompile” Java class files? [closed]
- How do I determine whether an array contains a particular value in Java?
- How to initialize an array in Java?
- How does the Java ‘for each’ loop work?
- Java 8 Iterable.forEach() vs foreach loop
- Initialize part of an array in java
- Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?
- How can I solve Exception in thread “main” java.lang.NullPointerException error [duplicate]
- How to split a string in Java
- What does “Could not find or load main class” mean?
- What does “Could not find or load main class” mean?
- Why am I getting a NoClassDefFoundError in Java?
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Eclipse/Maven error: “No compiler is provided in this environment”
- How do I compare strings in Java?