Giter VIP home page Giter VIP logo

vfox-java's People

Contributors

ahai-code avatar aooohan avatar gythialy avatar herouu avatar lordhumphrey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vfox-java's Issues

[BUG]: Java相同版本号无法安装不同发行版

Version
The version you are currently using
OS
macOS、Linux、Windows

Describe the bug
Java相同版本号,以21为例子,如果安装了OpenJDK,想去切换或者安装Azul时均提示java@21 is already installed

Screenshots[optional]
image

`install` should respect distribution parameter

$ 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.

Could not install Java version

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

在安装[email protected]+7后,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"
}

参考:http://www.loongnix.cn/zh/api/java/

Possible to install the latest version of a specfic Java distribution?

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)

`install` should be tolerant to space

$ 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.

vfox use -g java fails on msys2 git-bash on Windows in Windows Terminal

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*
....

vfox use java选择后java命令报找不到JRE

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

[Feature] 支持检测当前系统使用的 libc 信息并添加到 foojay 的请求参数中

请求 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

建议请求https://api.foojay.io/disco/v3.0/packages/jdks添加lib_c_type参数

在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后正常

完整url如下
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

search distribution

When search for a specific distribution like zulu it returns OpenJDK versions instead(I guess it's the default one).

e.g.:
image

Cannot install plugin

When I run the command: vfox add java
I get an error: invalid plugin name, format: <category>/<plugin-name>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.