version-fox / vfox-java Goto Github PK
View Code? Open in Web Editor NEW☕️Java plugin for vfox
Home Page: https://vfox.lhan.me
License: Apache License 2.0
☕️Java plugin for vfox
Home Page: https://vfox.lhan.me
License: Apache License 2.0
So far using use graalvm
only sets GRAALVM_HOME
but not JAVA_HOME
$ vfox install java tem
No java version provided, do you want to select a version to install? [y/N]: Yes
Please select a version of java to install [type to search]:
-> v22+36
I as user specify the variant of the JDK. When vfox
asks me for a version, it should use the version of the given distribution, not one from the default JDK.
In this case: OracleJDKs versions are displayed, not the ones of Eclipse Temurin.
比如 jdk 8不安装最新的版本,安装其中的某个小版本。
安装 java 22 失败
When I run the command
vfox install java@latest
I am getting
stack traceback:
[G]: in function 'error'
/Users/soufianeroui/.version-fox/plugin/java/lib/foojay.lua:35: in function 'fetchtJdkList'
/Users/soufianeroui/.version-fox/plugin/java/hooks/pre_install.lua:19: in main chunk
[G]: ?
failed to install java
vfox i [email protected]+7后想看下是否安装成功,然后出现了下面的错误
C:\Users\ADMIN>java
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
然后我看了下环境变量,path加了 G:\java\current,然后我在此目录下运行java不能直接运行
G:\java\current>java
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
然后到安装目录下运行是可以
G:\java\v-8.0.342+7\java-8.0.342+7\bin>java
用法: java [-options] class [args...]
(执行类)
或 java [-options] -jar jarfile [args...]
(执行 jar 文件)
其中选项包括:
-d32 使用 32 位数据模型 (如果可用)
-d64 使用 64 位数据模型 (如果可用)
-server 选择 "server" VM
默认 VM 是 server.
目前我的解决方法只能在path将 G:\java\current 改为 %JAVA_HOME%\bin
https://api.foojay.io/disco/v3.0/packages/jdks?version=&distribution=openjdk&architecture=loong64&archive_type=tar.gz&operating_system=linux&release_status=ga&directly_downloadable=true&latest=available
{
"result":[],
"message":"invalid architecture"
}
For example: vfox install java@latest-tem
should install the latest version of Temurin. Is it possible?
I tried and failed:
> vfox install java@latest-tem
plugin [PreInstall] method error: C:\Users\regun\.version-fox\plugin\java\lib\foojay.lua:35: Failed to fetch jdk info from foojay: status_code =>500
stack traceback:
[G]: in function 'error'
C:\Users\regun\.version-fox\plugin\java\lib\foojay.lua:35: in function 'fetchtJdkList'
C:\Users\regun\.version-fox\plugin\java\hooks\pre_install.lua:19: in main chunk
[G]: ?
failed to install java
Edit: An even better version would be something like vfox install java@21-tem:latest
.
asdf java plugin support it (as shown here)
$ vfox install java 22.0.1+8-tem
No java version provided, do you want to select a version to install? [y/N]: No
[22.0.1+8-tem] not added yet, confirm that you want to use [22.0.1+8-tem]?
Please confirm [y/N]: Yes
[22.0.1+8-tem] not found in remote registry, please check the name
failed to install 22.0.1+8-tem
At the first prompt, vfox
should now, I want to have [email protected]+8-tem
.
With @
instead of space it works:
$ vfox install [email protected]+8-tem
Preinstalling [email protected]+8-tem...
However, it is strange that at the first "interaction", ´22.0.1+8-tem` is somehow recognized as verson, but later not found anywhere.
UPDATE: this is a duplicate of version-fox/vfox#292
I'm on the latest version of vfox 0.5.3 installed via scoop
vfox use java
works, after command -v java
points to /c/Users/ben/.version-fox/temp/1716706800-4624/java/bin/java
Also /c/Users/ben/.version-fox/cache/java/current/bin/java -version
works
Same problem for nodejs.
ben@lenovo-legion ~$ vfox use -g java
Please select a version of java:
-> 21.0.2+13
failed to read bin paths:/c/Users/ben/.version-fox/cache/java/current/bin: open /c/Users/ben/.version-fox/cache/java/current/bin: The system cannot find the path specified.
More details:
ben@lenovo-legion ~$ vfox upgrade
Current version: v0.5.3
Latest available: v0.5.3
vfox is already up to date.
ben@lenovo-legion ~$ vfox update java
Checking plugin manifest...
java is already the latest version
ben@lenovo-legion ~$ vfox use -g java
Please select a version of java:
-> 21.0.2+13
failed to read bin paths:/c/Users/ben/.version-fox/cache/java/current/bin: open /c/Users/ben/.version-fox/cache/java/current/bin: The system cannot find the path specified.
ben@lenovo-legion ~$ ls /c/Users/ben/.version-fox/cache/java/current/bin
api-ms-win-core-console-l1-1-0.dll* api-ms-win-core-util-l1-1-0.dll* j2pcsc.dll* jimage.dll* management_agent.dll*
....
open jdk8的java -version报
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
java/current目录下没有java.dll
请求 https://api.foojay.io/disco/v3.0/packages/jdks 的时候 lib_c_type 参数现在默认为 glibc (#14)
https://api.foojay.io/disco/v3.0/packages/jdks?version=17.0.11%2B9&distribution=temurin&architecture=amd64&archive_type=tar.gz&operating_system=linux&release_status=ga&latest=available&lib_c_type=glibc
在 alpine 等系统上,它们使用的是 musl,那么参数就要变:
https://api.foojay.io/disco/v3.0/packages/jdks?version=17.0.11%2B9&distribution=temurin&architecture=amd64&archive_type=tar.gz&operating_system=linux&release_status=ga&latest=available&lib_c_type=musl
在ubuntu 22.04中使用vfox install [email protected]+9-tem下载的jdk版本是OpenJDK17U-jdk_x64_alpine-linux_hotspot_17.0.11_9.tar.gz,无法使用。
使用jabba下载正确,https://github.com/Jabba-Team/index-generator/blob/main/src/index.js,
发现其多一个参数lib_c_type=glibc
编辑.version-fox/plugin/java/lib/foojay.lua 在请求url添加&lib_c_type=glibc后正常
When I run the command: vfox add java
I get an error: invalid plugin name, format: <category>/<plugin-name>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.