Forgetting to set JAVA_HOME leads to a somewhat cryptic error message.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 534
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Description
When I try to init pyimagej on osx I get the following error. (truncated!)
File "env/lib/python3.13/site-packages/scyjava/_jvm.py", line 74, in jvm_version
p = Path(default_jvm_path)
TypeError: argument should be a str or an os.PathLike object where fspath returns a str, not 'bytes'
If I point JAVA_HOME at a valid java jdk then I don't get this error.
I think there are two points here:
- It is failing to use a fallback version check because of an unexepected error.
- It doesn't report this error is occuring while trying to find java (though implied in the stacktrace)
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scyjava/_jvm.py around line 74 and trace the JVM discovery path used when pyimagej is initialized without JAVA_HOME. Reproduce the error on macOS with JAVA_HOME unset, then compare it with a valid JDK configuration. Done means the fallback check handles the reported condition and the resulting error identifies that Java discovery failed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100