E: Unable to locate package openjdk-11-jdk - maven

I try to create docker image:
It is my Dockerfile:
FROM maven:3-jdk-11
# Common files and utils for build
RUN apt-get update && apt-get install -y make fakeroot rpm dpkg-dev apt-utils wget unzip
RUN apt-get install -y -q software-properties-common desktop-file-utils
# Then Wine with all deps
RUN dpkg --add-architecture i386 && apt-get update
RUN apt-get install -y --install-recommends wine
RUN apt-cache search openjdk
RUN apt-get install -y openjdk-11-jdk
RUN apt install -y openjfx11 libopenjfx-java libopenjfx-jni
RUN apt-get install -y --install-recommends wine32
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV JAVAFX_HOME /usr/share/java/openjfx11
# And we ready to play with our code
ARG SRCDIR=.
ARG DSTDIR=/usr/src/CryptoStock
ARG CACHEDIR=./cache
# Subject to be used here but should be command line, sic!
# ADD ${CACHEDIR} /root/.m2
# ADD ${SRCDIR} /mnt/src
RUN mkdir -p /root/.m2/repository
COPY settings.xml /root/.m2/settings.xml
COPY settings-security.xml /root/.m2/settings-security.xml
COPY jdk11-build-in-docker.sh ${DSTDIR}/jdk11-build-in-docker.sh
COPY ./static/. ${DSTDIR}/static
COPY ./3rdparty/. ${DSTDIR}/3rdparty
COPY ./winjdk11/. ${DSTDIR}/winjdk
ENV SOURCES /usr/src/CryptoStock
ENV OUTSIDE /mnt/src
RUN dpkg -l '*openjfx*'
RUN dpkg -l '*jdk*'
WORKDIR ${DSTDIR}
CMD [ "sh", "/usr/src/CryptoStock/jdk11-build-in-docker.sh" ]
When I try to build I don't to watch java 11:
Step 6/27 : RUN apt-cache search openjdk
---> Running in e03b4c69fa69
jtreg - Regression Test Harness for the OpenJDK platform
openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
openjdk-8-jdk - OpenJDK Development Kit (JDK)
openjdk-8-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-8-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openjdk-8-source - OpenJDK Development Kit (JDK) source files
openjdk-8-jre-dcevm - Alternative VM for OpenJDK 8 with enhanced class redefinition
uwsgi-plugin-jvm-openjdk-8 - Java plugin for uWSGI (OpenJDK 8)
uwsgi-plugin-jwsgi-openjdk-8 - JWSGI plugin for uWSGI (OpenJDK 8)
uwsgi-plugin-ring-openjdk-8 - Closure/Ring plugin for uWSGI (OpenJDK 8)
uwsgi-plugin-servlet-openjdk-8 - JWSGI plugin for uWSGI (OpenJDK 8)
Removing intermediate container e03b4c69fa69
---> 1fae3b35c58b
Step 7/27 : RUN apt-get install -y openjdk-11-jdk
---> Running in 288fb5247ce6
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package openjdk-11-jdk
The command '/bin/sh -c apt-get install -y openjdk-11-jdk' returned a non-zero code: 100
There is only java 8, there is no java 11.

OpenJDK 11 is installed by default in the maven:3-jdk-11 image:
$ docker run maven:3-jdk-11 java --version
openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment 18.9 (build 11.0.16+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.16+8, mixed mode, sharing)
It is also available via the Debian package system:
$ docker run maven:3-jdk-11 sh -c 'apt update && apt-cache search openjdk-11'
[...]
openjdk-11-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-11-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-11-doc - OpenJDK Development Kit (JDK) documentation
openjdk-11-jdk - OpenJDK Development Kit (JDK)
openjdk-11-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-11-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-11-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-11-jre-zero - Alternative JVM for OpenJDK, using Zero
openjdk-11-source - OpenJDK Development Kit (JDK) source files
[...]
Today the maven:3-jdk-11 image is using Debian 11 (Bullseye), but when you wrote your question the maven:3-jdk-11 image was probably using a Debian 9 (Stretch) image with OpenJDK 11 installed but not available through the Debian package system. This explains your error.

Related

Quarkus Install Error [jbang] [ERROR] java.nio.charset.MalformedInputException

I am following the Getting Started Guide from the Quarkus site to try out Quarkus. But, when I execute this curl command
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus#quarkusio
the following error is displayed.
[jbang] [ERROR] java.nio.charset.MalformedInputException: Input length = 1
Running quarkus install on Mac (Intel) running Monterey OS and here's my java info:
java --version
java 11.0.6 2020-01-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)
whereis java
java: /usr/bin/java
which java
/Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home/bin/java
Can somebody please let me know what I might be doing wrong?
Thanks
I used SDKMAN! to install Quarkus and that seemed to work.

jps command not found while installing hadoop

ian new to centos 7
and iam configuring hadoop 2.7.1 cluster so i need to install openjdk as a requirement
so i installed one by the command
yum install java-1.7.0-openjdk
and java version command out put is
java version "1.7.0_131"
OpenJDK Runtime Environment (rhel-2.6.9.0.el7_3-x86_64 u131-b00)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)
but my problem is that i want to use jps command and it is found in
java-1.7.0-openjdk-1.7.0.101-2.6.6.1.el7_2.x86_64
so i iwant to install this rpm and i used the command
cd /usr/lib/jvm
rpm -ivh --nodeps ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/updates/security/java-1.7.0-openjdk-1.7.0.101-2.6.6.1.el7_2.x86_64.rpm
but becuase a newer version of jdk is installed i wasn't able to install this rpm
with the error
package java-1.7.0-openjdk-1:1.7.0.131-2.6.9.0.el7_3.x86_64 (which is newer than java-1.7.0-openjdk-1:1.7.0.101-2.6.6.1.el7_2.x86_64) is already installed
i don't know if iam using the right way to make jps command works
what should i do to include jps command
and is it right to install an old release of openjdk i mean 101 when newer one already exists i mean 131
java-1.7.0-openjdk contains only the JRE. jps is part of the openjdk development package. Refer here.
Try
yum install java-1.7.0-openjdk-devel

Using Gradle with OpenJDK 1.9

I cannot seem to use Gradle with OpenJDK 1.9.
When I run the following command:
react-native run-android
I end up getting this error.
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9-internal'.
Running java -version shows me:
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
Any ideas how I can fix this?
Which version of gradle are you using?
cd android
./gradlew -version
I think there was a bug determining versions for java 1.9 which was fixed in Gradle 2.10.
Another option is to try spoofing a java.version that Gradle can parse
export JAVA_TOOL_OPTIONS='-Djava.version=1.9'
react-native run-android
#see JavaVersion.java and JavaVersionSpec.groovy
This seems to be an incompatibility with your build of OpenJDK 9 and Gradle.
Your OpenJDK version is:
openjdk version "9-internal"
And it appears Gradle can't parse it:
Could not determine java version from '9-internal'.
Looks like gradle is prepared to accept 9-ea, but not 9-internal.
You will have to modify your build of OpenJDK to have it return "9-ea" or something similar for java -version.
The following configure options when building OpenJDK 9 should do the trick:
configure \
--with-version-pre="ea" \
--with-version-opt="" \
... your other options ...
I had the same exact issue and, in my case, it worked by removing OpenJDK:
sudo rm /var/lib/dpkg/info/openjdk-*
sudo apt-get purge openjdk-*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
and installing the Oracle Java SDK:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
I know this is not the exact answer (using Gradle with OpenJDK 1.9), but I managed to keep going and run the app both in a virtual device and in my smartphone. Hope it helps.
Note: I am running react-native: 0.40.0 and react-native-cli: 2.0.1 in Ubuntu 16.04

gradle -v does not work and gives java errors

I can't seem to get gradle to install on work on opensuse 13.2.
Installed by:
sudo unzip -oq gradle-2.2.1-all.zip -d /opt/gradle
sudo ln -sfn gradle-2.2.1 /opt/gradle/latest
export GRADLE_HOME=/opt/gradle/latest
export PATH=$GRADLE_HOME/bin:$PATH
running gradle:
$gradle -v
java.lang.NoClassDefFoundError: org.gradle.util.CollectionUtils
at java.lang.Class.initializeClass(libgcj.so.14)
at org.gradle.internal.classpath.DefaultClassPath.<init>(DefaultClassPath.java:37)
at org.gradle.api.internal.classpath.EffectiveClassPath.<init>(EffectiveClassPath.java:32)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:61)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:44)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableList not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/opt/gradle/gradle-2.2.1/lib/gradle-launcher-2.2.1.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at java.lang.ClassLoader.loadClass(libgcj.so.14)
at java.lang.Class.initializeClass(libgcj.so.14)
...7 more
Have you tried adding the symlink in /usr/bin?
Like this:
sudo ln -s /opt/gradle/latest/bin/gradle /usr/bin/gradle
It worked for me in openSuse 13.2
Make sure gradle is using Java 1.8
> $JAVA_HOME/bin/java -version
Should return
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (IcedTea 3.8.0) (build 1.8.0_171-b11 suse-24.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
My box had $JAVA_HOME linked to Java 1.5

How to compile an OpenJDK 7 debug build on Ubuntu 11.10

Where can I find a simple set of instructions to compile an OpenJDK 7 debug build on Ubuntu 11.10 (Oneiric)? A debug build would make more JVM options available for troubleshooting purposes; for example, WizardMode. The developers' guide and build README have a lot of noise and are hard to follow.
Install relevant packages:
sudo apt-get install ant build-essential openjdk-6-jdk
sudo apt-get build-dep openjdk-6-jdk
Find the master OpenJDK Mercurial repository you want to start from. These instructions will use jdk7u2.
Command examples contain settings to allow Internet access through a proxy server; remove them if they are unnecessary for you.
Clone the Mercurial top-level forest repository:
$ mkdir jdk7u2
$ cd jdk7u2
$ hg --config http_proxy.host=proxy:1234 clone http://hg.openjdk.java.net/jdk7u/jdk7u2 forest
$ cd forest
$ sh ./get_source.sh
The build will fail while compiling the sound libraries. As suggested here, use the following to patch the appropriate Makefile:
$ echo -e "--- old/jdk/make/javax/sound/jsoundalsa/Makefile 2012-01-28 12:00:00.000000000 -0500\n+++ new/jdk/make/javax/sound/jsoundalsa/Makefile 2012-01-28 12:00:00.000000000 -0500\n## -65,7 +65,7 ##\n \t\$(MIDIFILES_export) \\\\\n \t\$(PORTFILES_export)\n\n-LDFLAGS += -lasound\n+EXTRA_LIBS += -lasound\n \n CPPFLAGS += \\\\\n \t-DUSE_DAUDIO=TRUE \\\\" | patch -p1
Compile:
$ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=1234 -Dhttps.proxyHost=proxy -Dhttps.proxyPort=1234"
$ . jdk/make/jdk_generic_profile.sh
$ make ALLOW_DOWNLOADS=true fastdebug_build
The compile will take a while.
Verify the build:
$ build/linux-amd64-fastdebug/j2sdk-image/bin/java -version
openjdk version "1.7.0-internal-fastdebug"
OpenJDK Runtime Environment (build 1.7.0-internal-fastdebug-user_2012_01_28_13_25-b00)
OpenJDK 64-Bit Server VM (build 22.0-b10-fastdebug, mixed mode)
$ build/linux-amd64-fastdebug/j2sdk-image/bin/java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -XX:+PrintFlagsWithComments -version
If you have problems along the way, begin by reading The OpenJDK Developers' Guide and the OpenJDK Build README.

Resources