Skip to content

指定mvn版本后,执行mvn报错 #2

@mapleafly

Description

@mapleafly

执行mvn -version 报错如下:
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.

win11操作系统。我的vfox从0.3一路升到的0.51。这次打算java maven gradle python nodejs统一使用vfox管理。于是先删除了所有插件,修改sdkPath: D:\version-fox。 重装插件,重装sdk。大概是这个过程。
安装完java后,环境变量为:
JAVA_HOME: D:\version-fox\java\current
VERSION_FOX_PATH: D:\version-fox\java\current\bin
path : D:\version-fox\java\current\bin

在cmd和powershell中一切正常。
继续安装maven,最后,执行 vfox use maven@3.8.6提示成功。 在powershell中执行 mvn -version 提示以上的报错。
查看环境变量,没有任何和mvn相关的环境变量生成。
.tool-versions文件中也没有生成mvn相关的内容。

求指教这是什么原因造成的。

另外,gradle也是这个问题,大概需要java支持的都有这个问题?
nodejs没有这个问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions