Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting JAVA_HOME

71 views
Skip to first unread message

Geert Stappers

unread,
Feb 28, 2021, 8:40:02 AM2/28/21
to
Hi,


To what should JAVA_HOME be set?

Or: Which value has JAVA_HOME for you?



Yeah, simple things should be simple.



Groeten
Geert Stappers


P.S.

My travelled path
https://wiki.debian.org/Java
https://wiki.debian.org/JavaFAQ
http://www.debian.org/doc/manuals/debian-java-faq/
https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=java-common;dist=unstable
--
Silence is hard to parse

Thorsten Glaser

unread,
Feb 28, 2021, 8:50:03 AM2/28/21
to
On Sun, 28 Feb 2021, Geert Stappers wrote:

> To what should JAVA_HOME be set?

It should be unset. Also ideally, you have only ever one JRE installed.

Everything else is a nightmare.

To make this work with Java >8 and Maven, you’ll need¹…

<profile>
<id>jre-not-below-jdk</id>
<activation>
<file>
<exists>${java.home}/bin/javadoc</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
</plugin>
</plugins>
</build>
</profile>

… or the Debian-patched version of the maven-javadoc-plugin.

bye,
//mirabilos
① see https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=tartools/mvnparent.git
or use…
<parent>
<groupId>org.evolvis.tartools</groupId>
<artifactId>maven-parent</artifactId>
<version>2.1</version>
</parent>
--
Infrastrukturexperte • tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

*************************************************

Mit dem tarent-Newsletter nichts mehr verpassen: www.tarent.de/newsletter

*************************************************

Geert Stappers

unread,
Feb 28, 2021, 9:20:03 AM2/28/21
to
On Sun, Feb 28, 2021 at 02:43:34PM +0100, Thorsten Glaser wrote:
> On Sun, 28 Feb 2021, Geert Stappers wrote:
>
> > To what should JAVA_HOME be set?
>
> It should be unset. Also ideally, you have only ever one JRE installed.
>
> Everything else is a nightmare.

:-)


> To make this work with Java >8 and Maven, you’ll need¹…
>
> <profile>
> <id>jre-not-below-jdk</id>
> <activation>
> <file>
> <exists>${java.home}/bin/javadoc</exists>
> </file>
> </activation>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-javadoc-plugin</artifactId>
> <configuration>
> <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
>
> … or the Debian-patched version of the maven-javadoc-plugin.
>


Sharing my "nightmare" with you

| $ javaws ~/Downloads/launch\(3\).jnlp
| Codebase matches codebase manifest attribute, and application is signed. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
| Starting application [tw.com.aten.ikvm.KVMMain] ...
| Buf size:425984
| Exception in thread "AWT-EventQueue-1" javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created
| at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:305)
| at java.xml/javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:261)
| at java.xml/javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:140)
| ...Java stack trace...


Manual page of `javaws` mentions JAVA_HOME

With `apt-file search DocumentBuilderFactory` I did found
| openjdk-11-doc: /usr/share/doc/openjdk-11-jre-headless/api/java.xml/javax/xml/parsers/DocumentBuilderFactory.html
| openjdk-11-doc: /usr/share/doc/openjdk-11-jre-headless/api/java.xml/javax/xml/parsers/class-use/DocumentBuilderFactory.html
| openjdk-15-doc: /usr/share/doc/openjdk-15-jre-headless/api/java.xml/javax/xml/parsers/DocumentBuilderFactory.html
| openjdk-15-doc: /usr/share/doc/openjdk-15-jre-headless/api/java.xml/javax/xml/parsers/class-use/DocumentBuilderFactory.html
| openjdk-16-doc: /usr/share/doc/openjdk-16-jre-headless/api/java.xml/javax/xml/parsers/DocumentBuilderFactory.html
| openjdk-16-doc: /usr/share/doc/openjdk-16-jre-headless/api/java.xml/javax/xml/parsers/class-use/DocumentBuilderFactory.html
| openjdk-17-doc: /usr/share/doc/openjdk-17-jre-headless/api/java.xml/javax/xml/parsers/DocumentBuilderFactory.html
| openjdk-17-doc: /usr/share/doc/openjdk-17-jre-headless/api/java.xml/javax/xml/parsers/class-use/DocumentBuilderFactory.html


Hence the original
> > To what should JAVA_HOME be set?


At https://www.wikihow.com/Set-Java-Home#For-Linux I found
JAVA_HOME=/usr/java/jdk1.6.0_06/bin/java

But there is no /usr/java/ on my Debian system.


Transforming
> > Which value has JAVA_HOME for you?
into


Which sane value for JAVA_HOME should I try
with next `javaws launch.jnlp` ?



Groeten
Geert Stappers

Mechtilde

unread,
Feb 28, 2021, 9:30:03 AM2/28/21
to
Hello Geert,

at most of my Java packages i set

export JAVA_HOME := /usr/lib/jvm/default-java

in debian/rules

Regards

Mechtilde

Am 28.02.21 um 15:17 schrieb Geert Stappers:
Mechtilde Stehmann
## Apache OpenOffice
## Freie Office Suite für Linux, MacOSX, Windows und OS/2
## Debian Developer
## PGP encryption welcome
## F0E3 7F3D C87A 4998 2899 39E7 F287 7BBA 141A AD7F

OpenPGP_signature

Emmanuel Bourg

unread,
Feb 28, 2021, 12:20:03 PM2/28/21
to
Le 28/02/2021 à 15:26, Mechtilde a écrit :

> at most of my Java packages i set
>
> export JAVA_HOME := /usr/lib/jvm/default-java
>
> in debian/rules

You can remove it from debian/rules, unless you want to build with a
specific JRE (for example Java 8 when Java 11 is the default) that's
useless.

Emmanuel Bourg
0 new messages