version-fox / vfox

A cross-platform and extendable version manager with support for Java, Node.js, Flutter, .Net & more
https://vfox.lhan.me
Apache License 2.0
2.82k stars 102 forks source link

[Feature]: Automatically install SDKs #322

Open koppor opened 3 months ago

koppor commented 3 months ago

1. Your usage scenarios?

I cd in a directory and I expect the JDK to be available.

2. What is your expected outcome?

vfox asking for JDK installation if not installed yet.


Examples that sdk is set if installed:

$ cat /c/TEMP/x/.tool-versions
java 21.0.2+13

koppor@DESKTOP-KAK953S MINGW64 /c/TEMP/x (master)
$ java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13-58)
OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing)

$ cat /c/TEMP/y/.tool-versions
java 20.0.2+9

koppor@DESKTOP-KAK953S MINGW64 /c/TEMP/y
$ java -version
openjdk version "20.0.2" 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9-78)
OpenJDK 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)

koppor@DESKTOP-KAK953S MINGW64 /c/git-repositories/jabref-all/javafxreproducer (add-textfield-mwe)
$ cat .tool-versions
java 22.0.1+8-tem

koppor@DESKTOP-KAK953S MINGW64 /c/git-repositories/jabref-all/javafxreproducer (add-textfield-mwe)
$ java -version
openjdk version "20.0.2" 2023-07-18
OpenJDK Runtime Environment (build 20.0.2+9-78)
OpenJDK 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)
devbean commented 3 months ago

我也喜欢增加这个功能,这样就可以放到 CI 的脚本里面,在编译前自动安装并切换到所需要的依赖。我的 nodejs 项目,使用 volta 都是这样管理的。如果 vfox 能提供类似的功能就更好了。

ZuBB commented 2 weeks ago

I do not know the maintainers' opinion on this, but I would like to see this option turned off by default. Or at least configurable

koppor commented 2 weeks ago

I do not know the maintainers' opinion on this, but I would like to see this option turned off by default. Or at least configurable

For me vfox should ask interactively. This is what I meant with followign text

vfox asking for JDK installation if not installed yet.