Created
September 10, 2021 07:07
-
-
Save trinhpham/ba5bac01b4465b49ade2707c1923f8ed to your computer and use it in GitHub Desktop.
Download file from URL with pure JJS (jre javascript)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jjs | |
var url = new java.net.URL("https://download.java.net/openjdk/jdk11/ri/openjdk-11+28_linux-x64_bin.tar.gz"); | |
var inStream = new java.io.BufferedInputStream(url.openStream()); | |
var fileOutputStream = new java.io.FileOutputStream("openjdk-11.tar.gz"); | |
inStream.transferTo(fileOutputStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment