Giter Site home page Giter Site logo

jdk-wrapper's People

Contributors

coreen avatar vjkoskela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jdk-wrapper's Issues

Windows Support

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:

  • Determine the system architecture
  • Download the JDK from Oracle

Second, for Windows the Oracle JDK is available as an executable. The installer needs to be executed without requiring user interaction.

Support for tar.Z

The Solaris packages are also available as tar.Z packages from Oracle. The jdk-wrapper.sh script should be extended to support this extension.

Support for rpm

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).

Silent by default with optional verbose mode

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.

BusyBox/Alpine Wget Incompatibility

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.

https://busybox.net/downloads/BusyBox.html#wget

Minimize Cached JDK Files

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.

Weird issue with Mac command line failures

[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.

Clean before install

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.

Validate Checksum After Download

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 Cache Size

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.

Output Oracle License Before Download

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.