RaspberryPi 4 with Java 13.0.1 - java

Does anybody know how I can install Java 13.0.1 on a RaspberryPi 4?
Because I use [Java 13.0.1]1 on my WindowsEngine and so I wrote and exported my JavaApplication with Java 13.0.1 but the RaspberryPi only supports a licensed Version of Java 11.0.5 which is not available for free.

Surprised nobody has posted about this yet; you can totally install recent versions of Java on Raspbian.
In this example, I'll be using an AdoptOpenJDK OpenJDK build to install Java 14 on Raspbian Stretch.
# 1) Download the armhf jdk14 binary
wget 'https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/pool/main/a/adoptopenjdk-14-hotspot/adoptopenjdk-14-hotspot_14.0.0+36-2_armhf.deb'
# 2) now install it, and don't worry if it spits out a ton of errors, this is normal
sudo dpkg -i 'adoptopenjdk-14-hotspot_14.0.0+36-2_armhf.deb'
# 3) install missing dependencies
sudo apt-get install -f
And that's it! Running java -version now yields:
$ java -version
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment AdoptOpenJDK (build 14+36)
OpenJDK Server VM AdoptOpenJDK (build 14+36, mixed mode, sharing)

Ok,
I decided to download Java 11.0.5 to my windows engine and build the JavaProjects as a Java 11.0.5 Application.

Paying for any version of Java is getting ripped off: don't do it ever, unless you need to comply with licensing for a professional project (or something).
There isn't currently something you can install from apt-get, but Bell-SW has Java 13 packages for ARMv7 (you just have to scroll down) and they have instructions for how to install.
https://bell-sw.com/pages/java-13.0.2/
For free.

or just use the AdoptOpenJDK repos:
echo "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb buster main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo apt-get update
apt-cache search adoptopenjdk
sudo apt-get install adoptopenjdk-15-hotspot
Those are the condensed instructions for Linux RPM and DEB installer packages
apt-cache search adoptopenjdk - shows a list of packages (versions) available (incl. v8 & v11)
If you want/need to build JDK, you can start with this gist.

Related

Where is 'javac' in java-17-openjdk-amd64?

Win10 WSL 2 over an Ubuntu layer
Ubuntu: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal\
Java: java --version
openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-120.04, mixed mode, Sharing)
I've successfully installed openjdk 17.0.1, but there is no 'javac' command in bin (such as exists in java-11-openjdk-amd64/bin). There is no javac counterpart in java-17-openjdk-amd64/bin.
I've googled, oogled, and bugled to no great gain. In my experience, this means I'm missing something simple.
Someone please guide me here. What gives? How can I get the 'javac' command in openjdk 17.0.1, or how do I use that SDK to create a class?
RHEL/RockyLinux/CentOs/AlmaLinux etc: javac is in "devel" package
dnf -y install java-17-openjdk
dnf -y install java-17-openjdk-devel
Then set default versions
alternatives --config java
alternatives --config javac
I'm unsure which directions I used to install Open JDK before, but I followed the following instructions to remove and re-install: https://www.linuxcapable.com/how-to-install-openjdk-17-on-ubuntu-20-04/
I now have 'javac' in java-17-openjdk-amd64/bin.
Whew.
This worked for me
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-17/bin/javac" 1

JDK is installed on mac but i'm getting "The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt." sudo apt update

I'm trying to run the command sudo apt update on my terminal in MacOS
I'm getting this message in response: The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt. Please visit http://www.java.com for information on installing Java.
I saw a similar question here, however even though I made sure to install the JDK like the solution suggested I'm still getting the same response.
I also tried pasting
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
export JAVA_HOME="$HOME/.jenv/versions/`jenv version-name`"
Into my .zshrc.save folder and had no luck.
When I run java -version in the terminal this is what I get back:
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
20 years ago, java shipped with a tool called apt: Annotation Processor Tool. This tool was obsolete not much later.
What that update-node-js-version is talking about, is a completely and totally unrelated tool: It's the Advanced Package Tool, which is a tool to manage installations on debian and ubuntu - linux distros. You do not want to run this on a mac, and the instructions you found are therefore completely useless: That is how to update node-js on linux. Your machine isn't linux.
Search around for answers involving brew, which is the go-to equivalent of apt on mac. And completely forget about java - this has NOTHING to do with java - that was just a pure coincidence.
Install Homebrew on your Mac Machine
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
If you need to have openjdk first in your PATH, run:
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.profile
For compilers to find openjdk you may need to set:
export CPPFLAGS="-I/usr/local/opt/openjdk/include"
The below commands worked for me.
First, install the homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then set the Android Studio Java path to the Home(If you have Android Studio). If not then you take the respective Java path & export it to the JAVA Home path.
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home

GCP Datastore Emulator won't install on OpenJDK 10

I have a Ubuntu host on which i have installed OpenJDK 10 and Gloud SDK using APT. When i try to install 'google-cloud-sdk-datastore-emulator', i get the error shown below.
I found a thread on GCP GitHub that talks about this but its closed. Here - https://github.com/GoogleCloudPlatform/cloud-sdk-docker/issues/144
Anyone else having this issue?
Error -
# apt install google-cloud-sdk-datastore-emulator
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
google-cloud-sdk-datastore-emulator : Depends: openjdk-8-jdk but it is not installable
E: Unable to correct problems, you have held broken packages.
My Environment -
OS -
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
OpenJDK -
#java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
#javac -version
javac 10.0.2
#which java
/usr/bin/java
Gcloud sdk -
# gcloud -v
Google Cloud SDK 234.0.0
alpha 2019.02.08
beta 2019.02.08
bq 2.0.41
core 2019.02.08
gsutil 4.36
kubectl 2019.02.08
There's some issue with our debian package dependancy config.
Although if you install the emulator via gcloud command it should work:
gcloud components install cloud-datastore-emulator
(https://cloud.google.com/sdk/gcloud/reference/components/install)
Note the components manager doesn't work if sdk is insalled from other package managers. In this case you can remove it and install following the suggestion here: stackoverflow.com/questions/42697026
If for some other reason you do have to install via apt-get, https://serverfault.com/questions/250224 should help, basically avoid install openjdk by:
apt-get install google-cloud-sdk-datastore-emulator openjdk-8-jdk-
Note there's a "-" after the openjdk-8-jdk
Or you can follow the steps in the same thread to update package dependancy.
My solution involved using equivs to create a fake openjdk-8-jdk package (of course you need to make sure you have another JDK).
apt-get install equivs
equivs-control openjdk-8-jdk
vim openjdk-8-jdk # especially change the package name, but I also used 11.0.0 as a version (although it's probably not needed)
equivs-build openjdk-8-jdk
dpkg -i openjdk-8-jdk*.deb

How to change the default JRE in tomcat through parellel plesk

I have a parallel plesk console. Tomcat version istalled is 7. and JRE also 1.7. But some application is not working. So i need to change JRE 7 to JRE 8.
How it is possible through plesk console?
you need to uninstall JDK 7 and re-install JDK8.
for uninstalling java you can refer below links :
http://www.2daygeek.com/remove-uninstall-oracle-java-openjdk-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/#
https://askubuntu.com/questions/84483/how-to-completely-uninstall-java
Install JAVA 8
First of all, you need to add webupd8team Java PPA repository in your system. After that install, Oracle Java 8 using following a set of commands.
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
Verify Installed Java Version
After successfully installing Oracle Java using above step verify installed version using the following command.
mayank#tecadmin:~$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Configuring Java Environment
Also, install Java configuration package. It seems like below package is already installed with latest operating systems during installation of JAVA packages. But you can still make sure by running below command.
$ sudo apt-get install oracle-java8-set-default
Now edit /etc/environment configuration file and add following entries to set JAVA_HOME and JRE_HOME environment variables.
JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre

JRE error when trying to install Matlab Compiler Runtime

Once again, I spent much time trying to get something to work without success.
I want to install MATLAB Compiler Runtime on my Ubuntu 13.04, where there is no MATLAB installed.
Here's what I did:
I downloaded the 64-bit Linux version R2012b(8.0) off of
http://www.mathworks.com/products/compiler/mcr/index.html?s_cid=BB.
Then, I switched into the folder and tried to install via
sudo ./install just to receive the following message:
Error: Cannot locate Java Runtime Environment (JRE).
The directory /home/konni/Downloads/MCR_R2012b_glnxa64_installer/sys/java/jre/glnx86/jre does not exist.
And, it does not exist indeed, but there exists a folder with "glnxa86" instead of "glnx86". I wouldn't just want to rename it, though.
I do have a JRE installed on my machine, btw:
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
OpenJDK Server VM (build 23.7-b01, mixed mode)
I have absolutely no clue what to do. The problems I found using google didn't quite help me, either...
Maybe you have an idea?
I'd greatly appreciate any help! :-)
If the only problem is finding the JRE, then the command line switch -javadir will get you done:
./install -javadir /usr/lib/jvm/java-7-openjdk-i386/jre/
I had the same problem recently when installing a software that required a 7.13 MCR on an Ubuntu 17.10.
In this
https://www.linuxquestions.org/questions/linux-newbie-8/matlab-7-5-compiled-runtime-for-64-bit-linux-installation-no-jre-error-838281/
I found that the 32 bit version installs fine, and it did, but obviously, that didn't solve my problem.
However, I found a way to do it. The trick is that the installer needs the old JRE (1.5) and will not work with JDK 8.
So the first step is to run
./MCRInstaller.bin -is:extract
this will create a directory called istemp... something, for me istemp23732345211606.
ls
jre1.5.0-linux-amd64.bin JVMNotFound.txt setup.jar Verify.jar
It is tempting to run the setup.jar directly, do try, but with Java 8, I only got the following error message:
Could not load wizard specified in /wizard.inf (104)
But perhaps it will work for you. People who get the above mentioned error with wizard.inf should look further, because the installer needs JDK 5 to run.
I chose not to use the bundled version but downloaded the JDK 5 from Oracle. The bundled version might work as well - I did not try.
You can download JDK 5 from here:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR
Extract the downloaded archive (chmod +x the bin and run), then copy the files to /usr/lib/jvm/java5
Rename the jdk1.5.0_022 or anything to jdk1.5.0 to make it simple.
Fix attributes:
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/java5/jdk1.5.0
Then run:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java5/jdk1.5.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java5/jdk1.5.0/bin/javac" 1
Now chose the jdk 5 as default
sudo update-alternatives --config java
And selecting the appropriate option.
Check that it worked
java -version
You should see something like this:
java version "1.5.0_22" Java(TM) 2 Runtime Environment, Standard
Edition (build 1.5.0_22-b03) Java HotSpot(TM) 64-Bit Server VM (build
1.5.0_22-b03, mixed mode)
Now you can run the setup.jar file in the extracted directory (istemp...)
sudo java -jar setup.jar
I recommend that you chose a contemporary java by running
sudo update-alternatives --config java
again.
When running the installer.sh, use the command line option "-is:javahome [path to your java jre folder]".
For instance, I installed below a java 8 jre on an old matlab compiler 2007b as follow:
sudo /opt/installer.sh -console -is:javahome /usr/lib/jvm/java-8-openjdk-amd64/jre/
I had same problem. The problem is you are installing 64-bit matlab on 32-bit ubuntu. use 32-bit matlab and install in ubuntu 32-bit. use 64-bit matlab and install in ubuntu 64-bit. Please like the answer if it was helpful.

Categories

Resources