Giter Club home page Giter Club logo

bach's Introduction

Modules, modules, every where,
And class-path hell did shrink;
Modules, modules, every where,
Let sun.misc.Unsafe sink.

bach's People

Contributors

sormuras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bach's Issues

Cannot download OpenJDK using install-jdk.sh

It seems that a certificate error occurs and we can not download it using install-jdk.sh.

See https://travis-ci.org/mybatis/thymeleaf-scripting/jobs/525200361 .

Probably exit code '51' is SSL connection error of cURL. (https://curl.haxx.se/docs/manpage.html#51)

Current Status (inserted by @sormuras)

  • 2019-04-27 Underlying reason: NET::ERR_CERT_COMMON_NAME_INVALID for all download.java.net assets
  • 2019-04-28 "Delay applying a temporary workaround until ... mid of the coming week."
  • 2019-04-29 Oracle/Mark Reinhold is working on it ...
  • 2019-04-29 Updated install-jdk.sh to use https://download.oracle.com/java as the url prefix for OpenJDK assets

install-jdk.sh 2019-04-18 fails for OpenJDK 11

I am opening a new issue report as the error looks different than the one in #46 and #47.

$ sh install-jdk.sh --target test --feature "11" --license "GPL" --cacerts
install-jdk.sh 2019-04-18
Variables:
  feature = 11
  license = GPL
       os = linux-x64
      url = https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
   status = 200
  archive = /home/danysk/openjdk-11.0.2_linux-x64_bin.tar.gz
Downloading JDK from https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz...

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

No longer fetches JDK11

This no longer works for downloading early-access builds of OpenJDK 11. It gives:

install-jdk.sh 2018-07-17
Expected feature release number in range of 9 to 10, but got: 11

This may have been caused by a change to Oracle's site.

GraalVM support?

GraalVM has a different release schedule/versioning than OpenJDK. The work is still being done for JDK 11 support. Does it make sense to adds support GraalVM oss binaries in install-jdk.sh? Graal is super interesting because of it's native-image (java AOT) generation feature.

Relax the regex for GA builds

Looks like openjdk 12 just changed their download url scheme. I had been running against the release candidate just fine and the GA release today came out at:

https://download.java.net/java/GA/jdk12/GPL/openjdk-12_linux-x64_bin.tar.gz.sha256
https://download.java.net/java/GA/jdk12/GPL/openjdk-12_osx-x64_bin.tar.gz
https://download.java.net/java/GA/jdk12/GPL/openjdk-12_osx-x64_bin.tar.gz.sha256
https://download.java.net/java/GA/jdk12/GPL/openjdk-12_windows-x64_bin.zip
https://download.java.net/java/GA/jdk12/GPL/openjdk-12_windows-x64_bin.zip.sha256

Notice the difference with the following where they have .../jdk${feature}/NUMBER/GPL

https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
https://download.java.net/java/early_access/jdk13/12/GPL/openjdk-13-ea+12_linux-x64_bin.tar.gz

Not sure if this is a bug on their part or intended

JDK 10 download URL failes to connect to jdk.java.net port 80: Connection timed out

0.01s$ unset -v _JAVA_OPTIONS
before_script.2
0.20s$ wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
--2018-08-10 20:17:03--  https://github.com/sormuras/bach/raw/master/install-jdk.sh
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh [following]
--2018-08-10 20:17:03--  https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9544 (9.3K) [text/plain]
Saving to: ‘install-jdk.sh’
     0K .........                                             100%  108M=0s
2018-08-10 20:17:03 (108 MB/s) - ‘install-jdk.sh’ saved [9544/9544]
$ source install-jdk.sh -F 10 -L BCL
install-jdk.sh 2018-07-17
curl: (7) Failed to connect to jdk.java.net port 80: Connection timed out

Build failure on travis:
https://travis-ci.org/apereo/cas/jobs/414672861

Has the URL changed?

Implement better error messages

...when archive not found:

See https://travis-ci.org/sormuras/sormuras.github.io/jobs/386018676 -- it prints:

$ bash install-jdk.sh -L BCL --target $JAVA_HOME --workspace $HOME/.cache/install-jdk
install-jdk.sh 2018-05-30

The command "bash install-jdk.sh -L BCL --target $JAVA_HOME --workspace ..."
failed and exited with 1 during .

Better message: Can't determine ".tar.gz" to load. Tried url: ...

...when http://jdk.java.net/ "is down":

https://twitter.com/sormuras/status/1028504378062323712

Silent download possible?

Thanks for your nice tool! Currently trying it out a bit.

It looks although curl should download silently it stills logs heavily:

Saving to: ‘jdk-10_linux-x64_bin.tar.gz’
     0K .......... .......... .......... .......... ..........  0% 46.1M 7s
    50K .......... .......... .......... .......... ..........  0% 33.9M 9s
   100K .......... .......... .......... .......... ..........  0% 37.6M 9s
   150K .......... .......... .......... .......... ..........  0%  109M 7s

Improve options support

Implement tool options with

  • type safety
  • minimal documentation
  • semi-automatic conversion to strings

install-jdk.sh 2019-04-17 fails for OpenJDK11

$ ./install-jdk.sh --dry-run --license GPL --feature 11 --os linux-x64
install-jdk.sh 2019-04-17
Couldn't determine a download url for 11-GPL on linux-x641

This appears unrelated to #46, since I continue to get the same error message even when reverting fe56033, which was applied to fix that issue.

I think the root of the problem might be that early access for JDK 11 has ended: https://jdk.java.net/11/

Cf. 10 and 12:

$ ./install-jdk.sh --dry-run --license GPL --feature 10 --os linux-x64
install-jdk.sh 2019-04-17
Variables:
  feature = 10
  license = GPL
       os = linux-x64
      url = https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
   status = 200
  archive = /home/nick/openjdk-10.0.2_linux-x64_bin.tar.gz
$ ./install-jdk.sh --dry-run --license GPL --feature 12 --os linux-x64
install-jdk.sh 2019-04-17
Variables:
  feature = 12
  license = GPL
       os = linux-x64
      url = https://download.java.net/java/GA/jdk12.0.1/69cfe15208a647278a19ef0990eea691/12/GPL/openjdk-12.0.1_linux-x64_bin.tar.gz
   status = 200
  archive = /home/nick/openjdk-12.0.1_linux-x64_bin.tar.gz

jshell Bach.java fails...

Compilation chokes on current HEAD revision.

jshell https://raw.githubusercontent.com/sormuras/bach/master/src/bach/Bach.java

Error:
cannot find symbol
  symbol:   variable Property
    for (var property : Property.values()) {
                        ^------^
Error:
cannot find symbol
  symbol:   variable Action
      var action = Action.valueOf(Property.ACTION.get().toUpperCase());
                   ^----^
Error:
package Property does not exist
      var action = Action.valueOf(Property.ACTION.get().toUpperCase());
                                  ^-------------^
Error:
cannot find symbol
  symbol:   variable Action
        var action = Action.valueOf(argument.toUpperCase());
[...]
Error:
cannot find symbol
  symbol:   class Command
      var command = new Command(executable.toString()).addAll(arguments);
                        ^-----^
Error:
exception java.io.IOException is never thrown in body of corresponding try statement
      } catch (IOException e) {
        ^----------------------...
|  Welcome to JShell -- Version 11.0.2
|  For an introduction type: /help intro

This revision works!
jshell https://raw.githubusercontent.com/sormuras/bach/5e7165ef06c26423d8906038f2e061eb6cd8f374/src/bach/Bach.java

Here it stopped working...
jshell https://raw.githubusercontent.com/sormuras/bach/13cf5eb5a9045ac0158d6da585105d359591ba7f/src/bach/Bach.java

install-jdk.sh 2019-07-01 doesn't work on Mac

It seems you are not passing the right parameters when asking for a binary image using the AdoptOpenJDK API.
see https://travis-ci.org/forax/pro/jobs/552956389 for a failed job
the request that failed:
https://api.adoptopenjdk.net/v2/binary/releases/openjdk11?type=jdk&os=osx&arch=mac&release=latest&heap_size=normal&openjdk_impl=hotspot

the equivalent request that works:
https://api.adoptopenjdk.net/v2/binary/releases/openjdk11?openjdk_impl=hotspot&os=mac&arch=x64&release=latest&heap_size=normal&type=jdk

The os is "mac" and not "osx" and the architecture is "x64" and not "mac",
see the query parameters described by the API v2 doc

install-jdk.sh 2019-03-23 fails for OpenJDK12

sh install-jdk.sh --target test --feature "12" --license "GPL" --cacerts
install-jdk.sh 2019-03-23
Couldn't determine a download url for 12-GPL on linux-x64

The script works correctly for OpenJDK 11 and even for the JDK 13 preview:

sh install-jdk.sh --target test --feature "11" --license "GPL" --cacerts
install-jdk.sh 2019-03-23
Variables:
  feature = 11
  license = GPL
       os = linux-x64
      url = https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
   status = 200
  archive = /home/danysk/openjdk-11.0.2_linux-x64_bin.tar.gz
Downloading JDK from https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz...
sh install-jdk.sh --target test --feature "13" --license "GPL" --cacerts
install-jdk.sh 2019-03-23
Variables:
  feature = 13
  license = GPL
       os = linux-x64
      url = https://download.java.net/java/early_access/jdk13/16/GPL/openjdk-13-ea+16_linux-x64_bin.tar.gz
   status = 200
  archive = /home/danysk/openjdk-13-ea+16_linux-x64_bin.tar.gz
Downloading JDK from https://download.java.net/java/early_access/jdk13/16/GPL/openjdk-13-ea+16_linux-x64_bin.tar.gz...

Use jdk.java.net only

install-jdk.sh will only serve JDK builds available via https://jdk.java.net

Supporting AdoptOpenJDK "natively", i.e. mapping archived and released JDKs to AdoptOpenJDK API for downloading, will cease ... soon. You may still use AdoptOpenJDK builds via the --url option:

source install-jdk.sh --url 'https://api.adoptopenjdk.net/v2/binary/releases/openjdk11?openjdk_impl=openj9&os=linux&arch=x64&release=latest&heap_size=normal&type=jdk'

See more configurations here: https://travis-ci.org/sormuras/sormuras.github.io

chmod u+x *.jsh

...and remove - chmod u+x test.jsh build.jsh demo.jsh from .travis.yml

Gather resources

Resources from main and test should copied by the compile task to their respective target directories. Then tasks like jar or test can pickup the resources automatically.

Oracle JDK 10 download failing on Travis CI macOS

Hello,

I hope that this is not a duplicate issue - I browsed the closed one's and it seems like they were resolved. I am getting a download failure with the following Travis CI matrix config:

- os: osx
  osx_image: xcode9.4
  jdk: oraclejdk10

This leads to the following error:

$ export JAVA_HOME=${TRAVIS_HOME}/oraclejdk10
$ bash install-jdk.sh -F 10 -L BCL --target $JAVA_HOME --workspace ${TRAVIS_HOME}/.cache/install-jdk
install-jdk.sh 2018-08-16
Variables:
  feature = 10
  license = BCL
       os = osx-x64
      url = http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jdk-10.0.2_osx-x64_bin.tar.gz
   status = 302
  archive = /Users/travis/.cache/install-jdk/jdk-10.0.2_osx-x64_bin.tar.gz
Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jdk-10.0.2_osx-x64_bin.tar.gz...
The command "bash install-jdk.sh -F 10 -L BCL --target $JAVA_HOME --workspace ${TRAVIS_HOME}/.cache/install-jdk" failed and exited with 8 during .

You can see the failed build here:

https://travis-ci.org/TestFX/TestFX/jobs/428810403

Thanks very much for your work on this script, it has made installing various JDKs much nicer on Travis. Also I know that you are not responsible for it working on Travis, so maybe it would be more appropriate for me to open this issue on their issue tracker. If that's the case please feel free to let me know and close this. Thanks again.

Add Bach#jar()

Work-around: use Bach#execute

bach.execute(
  Bach.Command.of("jar")
    .add("-c")
    .add("--file").add("target/org.codefx.demo.advent.jar")
    .add("--main-class").add("org.codefx.demo.advent.Main")
    .add("-C").add(bach.path(Folder.TARGET_MAIN_COMPILED)).add(".")
  );

Support custom URL

Support something like --url https://what.ever... overriding look-up inside the script and use that user-defined URL for downloading a specific JDK release.

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.