Coder Social home page Coder Social logo

jyksnw / install-jdk Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 2.0 268 KB

install-jdk is a Python library for easily installing the latest OpenJDK for a given major version. Supports builds from Adoptium and Corretto. Simplify your Java development with the latest OpenJDK builds.

Home Page: https://pypi.org/project/install-jdk/

License: MIT License

Python 100.00%
adoptium adoptopenjdk cicd-tools corretto devops-tools java openjdk python3

install-jdk's Introduction

Hi there 👋

Buy Me A Coffee

install-jdk's People

Contributors

dependabot[bot] avatar jyksnw avatar robbie-palmer avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

install-jdk's Issues

[Errno 13] Permission denied: ASSEMBLY_EXCEPTION'

When I run

jdk.install('11', jre=True)

It return the following error and I don't know what to do:
[Errno 13] Permission denied: '/home/user/.jre/jdk-11.0.11+9-jre/legal/java.transaction.xa/ASSEMBLY_EXCEPTION'

Rerunning jdk.install on already installed version throws an error

When running jdk.install on a version that is already installed, the following error is raised:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Jason\Documents\GitHub\install-jdk\jdk_init_.py", line 93, in install
raise e
File "C:\Users\Jason\Documents\GitHub\install-jdk\jdk_init_.py", line 90, in install
jdk_dir = decompress_archive(jdk_file, jdk_ext, path)
File "C:\Users\Jason\Documents\GitHub\install-jdk\jdk_init
.py", line 60, in _decompress_archive
jdk_directory = extractor.extract_files(jdk_file, file_ending, destination_folder)
File "C:\Users\Jason\Documents\GitHub\install-jdk\jdk\extractor.py", line 72, in extract_files
jdk_directory = next(iter(end_listing.difference(start_listing)))
StopIteration

Add "OpenJDK" to PyPi description for SEO

Minor (but annoying!) issue!

Steps to reproduce:

  1. Search PyPi.org for "openjdk."

Expected Behavior

install-jdk somewhere near the top of results.

Actual Behavior

install-jdk not in results at all.

Happily it does show at the top when searching for "JDK" but a little SEO never hurt anyone.

Guidance to add `aarch64` support

Dear @jyksnw,

Context: @claudefalbriard and I would like to add support to Rasberry Pi, because we'd like to use it for educational activities involving py5 (@py5coding). We use @tabreturn's Thonny IDE plugin (https://github.com/tabreturn/thonny-py5mode) that helps set up JDK for py5 and depends on install-jdk.

I have experimented with os.uname().machine and it looks promissing to identify architecture.

Also, visiting https://api.adoptopenjdk.net/ I saw a warning about moving to https://api.adoptium.net and this guide: https://api.adoptopenjdk.net/migration.html

Would you like to guide us to a PR (or maybe more than one) that could address these issues?

Pass to adoptium

It seems that the current URL api.adoptopenjdk.net is deprecated (see home page), and that the URL should be changed to api.adoptium.net.

There is a migration guide that could be follow.

TypeError: str.join()

I run --

jdk.install('17')  # with and without a path argument

It looks like JDK downloads, but is perhaps failing at the extract step. I'm using Linux (x86_64, Ubuntu 22.04-based distro). Here's the output --

Traceback (most recent call last):
  File "_____/env/lib/python3.10/site-packages/jdk/__init__.py", line 102, in install
    jdk_dir = _decompress_archive(jdk_file, jdk_ext, path)
  File "_____/env/lib/python3.10/site-packages/jdk/__init__.py", line 70, in _decompress_archive
    jdk_directory = extractor.extract_files(
  File "_____/env/lib/python3.10/site-packages/jdk/extractor.py", line 71, in extract_files
    _safe_extract(tar, path=destination_folder)
  File "_____/env/lib/python3.10/site-packages/jdk/extractor.py", line 45, in _safe_extract
    member_path = path.join(path, member.name)
TypeError: str.join() takes exactly one argument (2 given)

Let me know if you need more info.

Does install-jdk support Python 3.8?

I'm told that import jdk raises a "TypeError: 'type' object is not subscriptable" exception in Python 3.8, and that this is a Python 3.8 issue. Did you drop support for Python 3.8? Your pyproject.toml file mentions Python 3.8 and the pypi page says 3.8 in the requirements section but lists 3.9 in the classifiers. Also, your readme has a Python 3.9-3.11 badge. If you don't support Python 3.8 anymore, that's fine, I can update my documentation to make that clear, but it would be helpful if pypi's requirements were for >= 3.9 so users couldn't install it on 3.8.

Thanks!

Setup Nox and PyTest

The project needs to be able to test better that there are no breaking changes in its supported Python version (targets 3.6+), along with its support for OpenJDK clients, platforms, and architectures. To support this, the project should be updated to use PyTest with some unit tests defined along with Nox to run those unit tests against various Python versions.

test.pypi.org project name

@Robbie-Palmer, I am revamping this library and see that you have claimed the install-jdk project on test.pypi.org. Can you release that project name by deleting your copy so I can get a proper release pipeline setup?

cgi is deprecated and slated for removal in Python 3.13

..\..\..\AppData\Python311\Lib\site-packages\jdk\client\client.py:1
  D:\AppData\Python311\Lib\site-packages\jdk\client\client.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

Reconciling with cjdk and/or jvm-index

Hello! 👋 I'm an author of jgo, and my colleague @marktsuchida is the author of cjdk. The cjdk project fills a very similar need to install-jdk, providing a command-line tool written in Python for downloading and caching JDKs. It uses jvm-index from the Coursier project as its source of truth for which JVM implementations are available from where, which makes things a bit easier.

For a while now, we have been scheming—when we have some spare time, which of course no one ever has...—to make cjdk a dependency of jgo, such that jgo can not only launch Java code from remote Maven repositories from the CLI, but also do so without a JDK/JRE already being present and available. However, since cjdk was written, we noticed that install-jdk has been actively developed for the past few months.

Therefore, I'm reaching out to get your thoughts on how—if at all—all of these projects might work together for the betterment of the community.

  • Were you already aware of cjdk? If so, how do you see the respective niches of install-jdk vs cjdk? Or if not, do you think it would make sense to join forces and share/consolidate any code?
  • Did you already know about the jvm-index? Maybe using it could help install-jdk to save some code in its implementation?
  • If cjdk and install-jdk could be combined into a single project meeting all requirements, that would be awesome. But if not, what do you think might be the best way forward for jgo to integrate some JDK-downloading functionality? Should I just pick one of cjdk or install-jdk, or might there be reasons to bake in both as options?

Looking forward to reading your thoughts! 😄

macOS Install Fails because of 404 error

When using on macOS the platform is reported back as darwin which then sets the url to pull for the OS darwin which is not a valid OS on the API. When darwin is detected the OS should be set to mac to comply with the API.

Cannot access Adoptium on Mac M2

Hello, I am trying to install jdk on my new mac and recieve a 404 error when trying to run jdk.install('17')).

I can run jdk.install('17', vendor='Azul')) as well as access that link directly in web browser.

However, for Adoptium, when running jdk.get_download_url('17') I get the following link for mac arm, which cannot be accessed from a web browser:
https://api.adoptium.net/v3/binary/latest/17/ga/mac/arm/jdk/hotspot/normal/eclipse

However, I changed to this architecture and this url works:
https://api.adoptium.net/v3/binary/latest/17/ga/mac/aarch64/jdk/hotspot/normal/eclipse

Any help for quickest way to setup on Mac M2 would be great and thanks in advance

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.