Giter Club home page Giter Club logo

Comments (6)

cmacdonald avatar cmacdonald commented on July 25, 2024 1

OpenJDK is available in Conda. Why not specify conda, and then not have to be bothered with repackaging openjdk for pip.

I'm sorry, I confess my lacks in understanding how Pyjnius works. While I think it makes perfect sense that the full JDK is needed when building, at the same time I would expect Pyjnius's runtime requirements from the jdk to be some subset of the JDK, and, specifically, the union between the set of JDK modules needed by the running application + some set of extra JDK modules required by Pyjnius itself (say, e.g. the Reflection API).

I widely agree with whats written here. We can investigate further (could you try to switch JAVA_HOME to a JRE and see if jnius continues to work).

from pyjnius.

cmacdonald avatar cmacdonald commented on July 25, 2024

I had some thoughts about this.

  1. Pyjnius allows access to all of Java, so limiting to particular modules probably precludes.

  2. IMO, any packaging of minimal Java for a particular Python application that use jnius seems out of scope for the Pyjnius project itself.

  3. The JDK is definitely needed for building Pyjnius. I haven't thought about the choice of JRE/JDK for using Pyjnius - but I have a feeling for the JDK is needed.

from pyjnius.

ennioVisco avatar ennioVisco commented on July 25, 2024

I had some thoughts about this.

Thanks for the nice comments, let me share my thoughts and ideas about it:

My comments on your nice thoughts

  1. Pyjnius allows access to all of Java, so limiting to particular modules probably precludes.

I definitely agree with this, I don't think Pyjnius should be limited in this sense.

  1. IMO, any packaging of minimal Java for a particular Python application that use jnius seems out of scope for the Pyjnius project itself.

I also agree with this, I don't believe necessarily that Pyjnius should be concerned by packaging, in my view, the ideal setting would just be to allow the user of Pyjnius to select a JRE that is different from the one at JAVA_HOME!

  1. The JDK is definitely needed for building Pyjnius. I haven't thought about the choice of JRE/JDK for using Pyjnius - but I have a feeling for the JDK is needed.

I'm sorry, I confess my lacks in understanding how Pyjnius works. While I think it makes perfect sense that the full JDK is needed when building, at the same time I would expect Pyjnius's runtime requirements from the jdk to be some subset of the JDK, and, specifically, the union between the set of JDK modules needed by the running application + some set of extra JDK modules required by Pyjnius itself (say, e.g. the Reflection API).
I would consider reasonable to include these dependencies at build time in Java, and therefore an ad-hoc runtime should work without any issues.

The use case I have in mind

My use case is pretty simple, I want to deliver a python package installable from pip (just like pyjnius), and I want to provide the right JRE to run the package so that:

  • the user doesn't need to install another external software (in this case the JDK)
  • the user might have a different JDK version in the running enviroments (because she is an active Java developer)
  • the user might want to use the output of my package as input to some other package using Pyjnius and that requires a different version of the JDK (in which case she'd have to manually play with the env variables to make this work)

Are these comments helpful on the topic? Please let me know if they are not :)

from pyjnius.

ennioVisco avatar ennioVisco commented on July 25, 2024

OpenJDK is available in Conda. Why not specify conda, and then not have to be bothered with repackaging openjdk for pip.

I'm sorry, I confess my lacks in understanding how Pyjnius works. While I think it makes perfect sense that the full JDK is needed when building, at the same time I would expect Pyjnius's runtime requirements from the jdk to be some subset of the JDK, and, specifically, the union between the set of JDK modules needed by the running application + some set of extra JDK modules required by Pyjnius itself (say, e.g. the Reflection API).

I widely agree with whats written here. We can investigate further (could you try to switch JAVA_HOME to a JRE and see if jnius continues to work).

Hello there, sorry for the late reply.
From a preliminary test it seems to be working by switching the JAVA_HOME to the path of the custom JRE.
I will need to make more complete tests (I'm now using the same machine, and it could be it somehow still detects JDK stuff), but in principle this seems to confirm that it can work :)

from pyjnius.

cmacdonald avatar cmacdonald commented on July 25, 2024

Thanks for the report. Probably some GitHub actions could be made that test this too.

from pyjnius.

cmacdonald avatar cmacdonald commented on July 25, 2024

Testing confirms jnius works with only a JRE - see #705.

from pyjnius.

Related Issues (20)

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.