Java Interface for Open-source Java Dev Kit & Runtime Envmt.

Moderator: Forum moderators

Post Reply
User avatar
rerwin
Posts: 154
Joined: Fri Jul 17, 2020 4:35 pm
Location: Maine, USA
Has thanked: 1 time
Been thanked: 82 times

Java Interface for Open-source Java Dev Kit & Runtime Envmt.

Post by rerwin »

Java Interface for Open-source Java Dev Kit & Runtime Environment plus pre-built download of 64-bit OpenJDK & IcedTea pet/SFS files
Copied and edited from Murga forum (http://oldforum.puppylinux.com/puppy/vi ... 65#1036881).

Now that Oracle has changed the packaging and licensing rules for Java, the open-source OpenJDK (& JRE) becomes essential for use in Puppy (and any Linux). Oracle licensing prohibits free redistribution of its proprietary versions. Java versions after 8 support only 64-bit architectures; versions after 10 no longer include the Java Network Launch Protocol (JNLP - javaws) feature. The 32-bit version of JRE may no longer be available for free.

I have upgraded the "Java Interface" (javaif) components to support OpenJDK, whether installed from the package manager repositories or obtained elsewhere. The JNLP function is provided by "Iced Tea" packages identified as icedtea-web or icedtea-netx, which are also in the repos.

A source of up-to-date 64-bit versions of OpenJDK and IcedTea is AdoptOpenJDK (https://adoptopenjdk.net). I have downloaded JDK (& JRE) 12, JDK 11 JDK-JRE and IcedTea-Web 1.8.3, and made SFS and pet packages of them, available from my MediaFire account:
http://www.mediafire.com/folder/n1gwntca5dh12/Open_Java

UPDATE 11/18/2019:
The LTS version, 11, has been updated to 11.0.5. I have uploaded an SFS file containing it and IcedTea-Web-1.8.3 together:
http://www.mediafire.com/file/0bc94x4yb ... 0.sfs/file
End of update

The "get_java" pet package has downoaded the Oracle-provided Javas as well as creating pets and SFS files for any java archive (tarball). It was intended to avoid re-distributing of the Oracle packages by letting users download their own copy. Now that I am aware that open-source versions are available, there is no need for the get_java download function.

Although get_java can build java archives into pets and SFS packages, that opertion is so simple that a separate tool is unnecessary. The steps:
  • 1. Download a tar.gz archive file from a web site.
  • 2. Create a new directory/folder, /opt/[jdk or jre]-[version from archive name].
  • 3. Click on the archive file and expand it into the new directory.
But why not just use the pre-built pet or SFS file? Whenever AdoptOpenJDK has a newer version than has been added to a Puppy repo or my MediaFire account, a user can easily make an SFS file. with mksquashfs, from a directory named [archive file name]/opt/[jdk or jre]-[version from archive name].

I have discontinued development of get_java and have removed it from woof-CE. I encourage placing the AdoptOpenJDK packages in the Puppy repos, for general access.

------------------------------------------------------------------------------

The simplest and probably best way to get the latest 32- or 64-bit version of open JRE is to install it from the PPM repos. Starting with Bionic Pup, the latest version is actually 11 along with Iced Tea 1.8. Installing the icedtea-netx package will include its dependency version of openjdk. The installed size is about 160M.

The BusterPup repo also has openjdk 11 but with icedtea-netx 1.7.2, which still works. However, installing its icedtea-netx or openjdk-jre may not include openjdk-jre-headless, which is required, so must be installed, too.

------------------------------------------------------------------------------

To check an installation of a Java package or to make it usable without rebooting, enter from a console/terminal:
javaiftest
If IcedTea-netx/Web is installed, this will include a check of the JNLP support. Be sure to respond to that prompt, to skip or select it. It will pop up a demonstration window.

To support the OpenJDK packages in Puppy distros built from woofCE before 2020, the attached version of javaif must be installed. Package javaif-20191009 supports open-source OpenJDK and IcedTea Java packages as well as
those in ubuntu & debian repositories. (Downloaded 198 times in Murga forum.)

Richard
Attachments
javaif-20191009.pet
(9.18 KiB) Downloaded 133 times
User avatar
rerwin
Posts: 154
Joined: Fri Jul 17, 2020 4:35 pm
Location: Maine, USA
Has thanked: 1 time
Been thanked: 82 times

Updated Java Interface for Open-source Java Dev Kit & Runtime Envmt.

Post by rerwin »

javaif-20230827.pet
Java Interface Update
(9.24 KiB) Downloaded 53 times

In response to a report that the Java Interface was not detecting certain Java packages, I have updated the Java Interface (javaif) components.

The new version recognizes the formerly undetected SFS package but also any package that set its own link to "java" in the package. If such a link is present, it overrides the default action of activating only the latest versions of Java JDK/jre and Icedtea/java-web (javaws).

Thank you to @MrAccident for calling my attention to the failure to detect some java packages.

A tool that I use to verify the selections by the interface is 'javaiftest'. It also reveals problem messages if they occur while checking versions. Some implementations may require additional effort to resolve problems, which are beyond my capabilities. Here is a sample of a successfule test:

# javaiftest
Java Interface Test and Demonstration

Environment:
JAVA_HOME=/opt/jdk-17.0.8+7
Java home & version: /opt/jdk-17.0.8+7 17.0.8
Java-Web home & version: /opt/icedtea-web-image 1.8.8

which java: /opt/jdk-17.0.8+7/bin/java
which javaws: /opt/icedtea-web-image/bin/javaws

java -version:
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7)
OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode, sharing)

javaws -version:
selected jre: /opt/jdk-17.0.8+7
WARNING: package sun.applet not in java.desktop
WARNING: package com.sun.net.ssl.internal.ssl not in java.base
WARNING: package javax.jnlp not in java.desktop
icedtea-web 1.8.8

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/my-applications/bin:/usr/games:/opt/jdk-17.0.8+7/bin:/opt/icedtea-web-image/bin

LD_LIBRARY_PATH=/lib:/usr/lib:/root/my-applications/lib:/usr/local/lib:/opt/jdk-17.0.8+7/lib/server

javac -verbose HelloWorldApp.java:
[parsing started SimpleFileObject[/initrd/mnt/tmpfs/tmp/HelloWorldApp.java]]
[parsing completed 30ms]
[search path for source files: .]
[search path for class files: /opt/jdk-17.0.8+7/lib/modules,.]
[checking HelloWorldApp]
[wrote HelloWorldApp.class]
[total 582ms]

java HelloWorldApp (expect Hello World!):
Hello World!

Enter any character to run an interactive JNLP example,
and/or <Enter>: n

javaws InputVerificationDemo.jnlp:
selected jre: /opt/jdk-17.0.8+7
sun.misc.Launcher not found. Running jdk9 or higher? Using unsecure BootClassLoader
Codebase matches codebase manifest attribute, but application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/te ... eploy.html for details.
The 'Permissions' attribute of this application is 'sandbox'. You have chosen the Sandbox run option, which overrides the Permissions manifest attribute, or the applet has already been automatically sandboxed.
Demonstration Completed
#

Please report any further issues encountered.

Richard

Post Reply

Return to “Utilities”