You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,17 @@ Remove type stubs when no longer needed:
58
58
python -m jvm --uninstall-stub
59
59
```
60
60
61
+
### PTH File Installation
62
+
63
+
Install a .pth file to enable automatic JVM import in your virtual environment:
64
+
65
+
```bash
66
+
# Install jvm.pth file for automatic import
67
+
python -m jvm --install-pth
68
+
```
69
+
70
+
This creates a `jvm.pth` file in your virtual environment's `site-packages` directory that automatically imports the JVM module when Python starts, enabling seamless Java class imports without manual initialization.
71
+
61
72
### Features
62
73
63
74
**Type Stub Management:**
@@ -67,6 +78,12 @@ python -m jvm --uninstall-stub
67
78
-**Auto-generation**: Generates fresh stubs from your JVM installation if needed
68
79
-**Virtual environment detection**: Works with venv, virtualenv, conda, and other Python environment managers
69
80
81
+
**PTH File Management:**
82
+
83
+
-**Install PTH file**: Creates a `jvm.pth` file in your virtual environment that automatically imports the JVM module at Python startup
84
+
-**Automatic import**: Enables seamless Java class imports without manual JVM initialization
85
+
-**Virtual environment safety**: Only works within active virtual environments for isolated setup
0 commit comments