Skip to content

Automatically fetch JRE - #542

Merged
ducky64 merged 4 commits into
masterfrom
auto-jre
Aug 2, 2026
Merged

Automatically fetch JRE#542
ducky64 merged 4 commits into
masterfrom
auto-jre

Conversation

@ducky64

@ducky64 ducky64 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Uses install-jdk to automatically fetch a JRE of the right version. Removes Java version issues from the setup docs. Bumps version.


Contributor License Agreement

By submitting this pull request, I agree to dual-license this contribution under both BSD 3-clause and Apache License, Version 2.0.

  • I agree to dual-license this contribution under both BSD 3-clause and Apache License, Version 2.0.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Python package to automatically provision a Java runtime for the Scala-based compiler core (via install-jdk), and correspondingly simplifies the setup/getting-started documentation while bumping the package version.

Changes:

  • Add install-jdk as a runtime dependency and use it to auto-install a JRE before launching the compiler JAR.
  • Remove/trim documentation that required manual Java installation; keep installation instructions to pip install edg.
  • Bump package version from 0.5.0 to 0.5.1.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
setup.md Removes the dedicated setup document (including manual Java/JDK instructions).
README.md Simplifies “Getting Started” to pip install edg and removes Java requirements mention.
pyproject.toml Version bump; add install-jdk; add mypy override for jdk module.
getting-started.md Simplifies setup section and adjusts IDE guidance/links.
edg/core/ScalaCompilerInterface.py Auto-installs a JRE and uses it to start the Scala compiler process.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 135 to 137
self.process = subprocess.Popen(
["java", "-jar", jar_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
[str(java_bin), "-jar", jar_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
Comment on lines +103 to +116
if self.kInstallJrePath.exists():
items = [
item
for item in self.kInstallJrePath.iterdir()
if item.is_dir() and ("jre" in item.name or "jdk" in item.name)
]
if len(items) > 0:
if len(items) != 1:
raise RuntimeError(f"Expected one JRE in {self.kInstallJrePath}, delete extras and re-run.")
java_bin_path = items[0] / "bin"
if not java_bin_path.exists():
raise RuntimeError(f"Expected JRE bin folder {java_bin_path} to exist.")
java_bin = java_bin_path / "java" # can't test this since it has os-specific extensions

Comment thread edg/core/ScalaCompilerInterface.py Outdated
Comment on lines +122 to +123
jdk.install("25", path=str(self.kInstallJrePath), jre=True)
installed = True
Comment thread README.md
pip install edg
```

Then, work through building a mechanical keyboard (including subcircuit layout replication) in the [getting started tutorial](getting-started.md).
Comment thread getting-started.md
```
pip install edg
```

@ducky64
ducky64 merged commit e65072b into master Aug 2, 2026
13 checks passed
@ducky64
ducky64 deleted the auto-jre branch August 2, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants