vjkoskela / jdk-wrapper Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
First, the jdk-wrapper.sh should be port to batch (e.g jdk-wrapper.bat) to support native execution under Windows. This will require alternate command tools to:
Second, for Windows the Oracle JDK is available as an executable. The installer needs to be executed without requiring user interaction.
The Solaris packages are also available as tar.Z packages from Oracle. The jdk-wrapper.sh script should be extended to support this extension.
The Linux packages are also available as rpm packages from Oracle. The jdk-wrapper.sh script should be extended to support this extension. The trick will be to detect the installation directory and generate the contents of environment file accordingly (e.g. settings for JAVA_HOME and PATH).
Ideally the jdk-wrapper.sh script should be a transparent wrapper. Consequently, the logging should by default by entirely off. All standard out/error should be redirected to /dev/null. Further, a verbose mode (e.g. controlled by JDKW_VERBOSE) would allow progress from the script and output from commands to be echoed to standard out/error.
The Alpine Docker base image based on BusyBox comes with a non-standard version of wget. This version of wget cannot be used to download the JDK from Oracle (no out of the box https support). The problem is that wget is detected as present and subsequently fails. For the time being curl has been promoted above wget to provide a work around. However, the wget check should detect the BusyBox variant and refuse to use it.
Remove all unnecessary files after installing a particular JDK version. For example, the original archive is completely unnecessary to keep around. On Mac the DMG is packed three times (DMG -> XAR -> CPIO) and the two intermediate forms can also be deleted (the pkg archive and the Payload directory).
Note: The value of this change will not be realized until clients purge their caches.
Oracle changed the lincense and the downloading pages, so there is no way to download the current JDK Versions (8+) via the Oracle web page. Instead, I would suggest to use the openJDK reference implementation to be used as source.
[10:06:43] Attempting download of JDK from primary http://cdn.azul.com/zulu/bin/zulu8.38.0.13-jdk8.0.212-macosx_x64.dmg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 99.84.239.9...
* TCP_NODELAY set
* Connected to cdn.azul.com (99.84.239.9) port 80 (#0)
> GET /zulu/bin/zulu8.38.0.13-jdk8.0.212-macosx_x64.dmg HTTP/1.1
> Host: cdn.azul.com
> User-Agent: curl/7.54.0
> Accept: */*
>
* The requested URL returned error: 404 Not Found
* stopped the pause stream!
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection 0
curl: (22) The requested URL returned error: 404 Not Found
[10:06:43] Attempting download of JDK from alternate http://cdn.azul.com/zulu/bin/zulu8.38.0.13-ca-jdk8.0.212-macosx_x64.dmg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 102M 100 102M 0 0 24.8M 0 0:00:04 0:00:04 --:--:-- 25.3M
[10:06:48] Unpacking dmg...
[10:06:55] xar -xf "/Volumes/Zulu OpenJDK 8.38.0.13/Double-Click to Install Zulu 8.pkg" . &> /dev/null
[10:07:01] hdiutil detach "/dev/disk3s1" &> /dev/null
[10:07:01] ERROR: hdiutil detach "/dev/disk3s1" &> /dev/null failed with 16
Retrying eventually worked.
After discovering that the environment file does not exist for the desired version, if the version directory does exist then it should be deleted (recursively) before proceeding with the download and unpacking. This will ensure any previous attempt's state is removed prior to re-install.
Download the checksum from the Oracle site (e.g. https://www.oracle.com/webfolder/s/digest/8u73checksum.html), generate it based on the downloaded archive and verify. The type of checksum to use (sha256 or md5) should be configurable with a reasonable default (e.g. JDKW_CHECKSUM). Ideally, if the first verify fails it should delete the archive, retry and then repeat the checksum and fail hard if the download is corrupted again.
Limit the number of JDK versions to store in the cache (e.g. JDKW_CACHE_MAX). Use least recently installed to delete the oldest cached JDK version when installing a new version that would otherwise exceed the cache limit.
Whenever a new JDK version is downloaded the Oracle license agreement should be printed out. As inconvenient as this may be it should be done even with when not in verbose mode (e.g. JDKW_VERBOSE not set or empty). Need to consider ways to make it easier to separate the license agreement from the output of the wrapped command in case the output is being processed further by another program/script.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.