Comments (6)
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.
I had some thoughts about this.
-
Pyjnius allows access to all of Java, so limiting to particular modules probably precludes.
-
IMO, any packaging of minimal Java for a particular Python application that use jnius seems out of scope for the Pyjnius project itself.
-
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.
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
- 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.
- 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!
- 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.
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.
Thanks for the report. Probably some GitHub actions could be made that test this too.
from pyjnius.
Testing confirms jnius works with only a JRE - see #705.
from pyjnius.
Related Issues (20)
- pyjnius build error on s390x HOT 10
- ClassNotFoundException for android.media.midi.MidiManager.OnDeviceOpenedListener HOT 3
- unexpected error for jdk17 HOT 4
- Crashes on Apple M1 HOT 27
- How to add everything under M2 repository to pyjnius classpath? HOT 2
- DeprecationWarning: pkg_resources is deprecated as an API
- pyjnius build error, still coming HOT 10
- Including a JAR on Android HOT 2
- Support mail address is broken HOT 2
- OverflowError: value too large to convert to jshort HOT 4
- How to create Webview with FileChooser HOT 1
- Moderinze `java` code? HOT 2
- installation documentation could be refreshed HOT 3
- AttributeError: 'Class' object has no attribute '_JavaClass__cls_storage' HOT 4
- Running python script on Android but in Docker container HOT 1
- Getting a pointer to JavaVM
- Dependency Dashboard
- No jvm.dll found HOT 3
- Unrecognized option: --add-exports / --add-opens HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyjnius.