Comments (7)
Can you share which Corretto package(s) you currently have installed?
The value /usr/lib/jvm/java-1.8.0-amazon-corretto
should work if you have a full jdk installed (package may have, for exmaple, -devel
suffix, depending on your distribution), while /usr/lib/jvm/java-1.8.0-amazon-corretto/jre
is just a runtime environment.
You'll notice in the error message that a full jdk is needed:
NB: JAVA_HOME should point to a JDK not a JRE
from corretto-8.
kage(s) you currently have installed?
in my docker file i have the below
FROM amazonlinux:2023
...
RUN dnf -y install java-1.8.0-amazon-corretto
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
...
Note im setting the JAVA_HOME env based on what i saw here: corretto/corretto-8-docker@055b9f3
Based on what you state, is the above just the JRE install then?
from corretto-8.
rebuilding the container with java-1.8.0-amazon-corretto-devel
seems to have resolved the issue. Curious, do i need to explicitly set JAVA_HOME in the case of the *-devel package?
from corretto-8.
rebuilding the container with
java-1.8.0-amazon-corretto-devel
seems to have resolved the issue. Curious, do i need to explicitly set JAVA_HOME in the case of the *-devel package?
I take this back...it doesnt work with java-1.8.0-amazon-corretto-devel
install either.
I had to export JAVA_HOME=/usr/lib/jvm/java
`java-1.8.0-amazon-corretto-devel also seem to install java 17
from corretto-8.
java-1.8.0-amazon-corretto-devel
should not be installing Java 17, I was not able to reproduce that on a fresh docker.
Are you also installing Maven from the AL2023 yum repositories? If so, that is what is pulling in Java 17. The reason is that Java 17 is the "system Java" for Amazon Linux 2023 and most packages that require Java are built against that version.
You can run dnf repoquery --installed --whatrequires java-17-amazon-corretto-headless
to see why java 17 is getting installed. /usr/lib/jvm/java
is an alternative setup by the RPMs being installed and should be pointing to the latest installed version. You can run realpath /usr/lib/jvm/java
and you should see it pointing to /usr/lib/jvm/java-17-amazon-corretto.x86_64
On a docker I started if I install java-1.8.0-amazon-corretto-devel
and maven
, I can then switch the Java version that mvn
picks up with setting JAVA_HOME
# mvn -v
Apache Maven 3.8.4 (Red Hat 3.8.4-3.amzn2023.0.5)
Maven home: /usr/share/maven
Java version: 17.0.9, vendor: Amazon.com Inc., runtime: /usr/lib/jvm/java-17-amazon-corretto.x86_64
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "5.4.257-177.360.amzn2int.x86_64", arch: "amd64", family: "unix"
bash-5.2# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/
bash-5.2# mvn -v
Apache Maven 3.8.4 (Red Hat 3.8.4-3.amzn2023.0.5)
Maven home: /usr/share/maven
Java version: 1.8.0_392, vendor: Amazon.com Inc., runtime: /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "5.4.257-177.360.amzn2int.x86_64", arch: "amd64", family: "unix"
from corretto-8.
ah..yes, i am installing maven - that answers that bit of confusion.
On the jdk (devel) vs jre - what are the JAVA_HOME supposed to be they seem different. In order to get Maven to find java,
for the JRE, i needed /usr/lib/jvm/java-1.8.0-amazon-corretto/jre
for the JDK, i needed to set /usr/lib/jvm/java
from corretto-8.
Maven is looking for $JAVA_HOME/bin/java
, see code snippet below, if you are building code you will need javac
which is in the java-1.8.0-amazon-corretto-devel
package anyway.
if [ -z "$JAVA_HOME" ] ; then
JAVACMD="`\\unset -f command; \\command -v java`"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
echo "The JAVA_HOME environment variable is not defined correctly," >&2
echo "this environment variable is needed to run this program." >&2
exit 1
fi
from corretto-8.
Related Issues (20)
- JVM paused for a long time when trying to reach safepoint HOT 2
- Problem with servlet application running on batch service. (org.springframework.batch.core) HOT 2
- Correto 8 usage error HOT 1
- JVM crash HOT 4
- java.lang.NoClassDefFoundError: sun.font.SunFontManager exception when moving from oracle jdk 8 to corretto jdk 1.8.0_362. HOT 9
- A fatal error has been detected by the Java Runtime Environment HOT 7
- A fatal error has been detected by the Java Runtime Environment HOT 3
- Java Corretto on workstations - Enterprise configuration HOT 1
- corretto version reports vulnerabilities in nessus scan. HOT 1
- Visual Studio C++ Redistributable has known EOL HOT 2
- crash during pyspak runing HOT 1
- jfxwebkit.dll cannot load HOT 1
- Can you help me? HOT 1
- OpenJDK Runtime Environment (8.0_382-b05) (build 1.8.0_382-b05) not adaper version when called HCCore.dll HOT 3
- Port JDK-8259943 to Java 8
- JVM crushed HOT 6
- SIGSEGV (0xb) at pc=0x4c8d4804e0c148f6, pid=46732, tid=0x00007faba7690700 HOT 7
- Regression: MSVC DLLs not found when using Javapackager with Corretto 8 versions after 8.372.07.1 HOT 1
- java.nio.Files.readAttributes() truncates file timestamps HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corretto-8.