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?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Bad Operand Types for Binary Operator “>”?
- How to use java.net.URLConnection to fire and handle HTTP requests
- ‘mvn’ is not recognized as an internal or external command, operable program or batch file
- How to use multiple classes in java in one file?
- Java: Multiple class declarations in one file
- How do you make a deep copy of an object?
- what does Dead Code mean under Eclipse IDE Problems Section
- java, get set methods
- How to solve DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502
- Javadoc @see or {@link}?
- Remote debugging a Java application
- What is difference between arm64 and armhf?
- What’s the difference between next() and nextLine() methods from Scanner class?
- How to fix java.net.SocketException: Broken pipe?
- Error: ‘else’ without ‘if’
- How to create a custom exception type in Java?
- Error: JavaFX runtime components are missing, and are required to run this application with JDK 11
- Even though JRE 8 is installed on my MAC -” No Java Runtime present,requesting to install ” gets displayed in terminal
- Extracting .jar file with command line
- UnsatisfiedDependencyException: Error creating bean with name
- Change priorityQueue to max priorityqueue
- Only using @JsonIgnore during serialization, but not deserialization
- java.lang.ArithmeticException: / by zero
- How can I convert a .jar to an .exe?
- How to fix “error: bad operand types for binary operator ‘||’ ” in java
- “The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe”
- Counting an Occurrence in an Array (Java)
- When is the finalize() method called in Java?
- Java “user.dir” property – what exactly does it mean?
- How can I check if a single character appears in a string?
- Java Error – Illegal Modifier for Parameter – Only final Permitted
- How do you add an ActionListener onto a JButton in Java
- Fatal error compiling: tools.jar not found:
- Java: Increment by 2 the two inputted integer
- Sending mail error, javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
- How do you set one array’s values to another array’s values in Java?
- ‘No JUnit tests found’ in Eclipse
- Popup Message boxes
- How to create a Multidimensional ArrayList in Java?
- wget: unable to resolve host address `http’
- Wrong project is being run in Eclipse
- Multidimensional Arrays lengths in Java
- atoi in java using charAt
- How to make a Java Main Menu Loop after using a case
- Quotation marks inside a string
- mysqldump to a tar.gz
- How can I export the privileges from MySQL and then import to a new server?
- What does “debconf: delaying package configuration, since apt-utils is not installed” mean?