简体   繁体   English

如何指定 java 版本与 Windows 上的 Ammonite Scala shell 一起使用?

[英]How do I specify the java version to use with the Ammonite Scala shell on Windows?

I am working on an enterprise system where I can't control my system Path environment variable, and the system path points to a version of Java that is currently broken.我在一个企业系统上工作,我无法控制我的系统 Path 环境变量,系统路径指向当前已损坏的 Java 版本。 I have another version of Java installed, and I would like to use that to run the Ammonite shell. Is this possible?我安装了另一个版本的 Java,我想用它来运行 Ammonite shell。这可能吗?

My hacky solution was to rename ammonite from amm.bat to amm-default.bat and create a new batch file called amm.bat that just adds my desired jre to the front of the session Path:我的 hacky 解决方案是将 ammonite 从 amm.bat 重命名为 amm-default.bat 并创建一个名为 amm.bat 的新批处理文件,它只是将我想要的 jre 添加到 session 路径的前面:

@echo off
set Path=C:\Users\bohlli\.jdks\corretto-1.8.0_292\bin;%Path%
amm_default.bat

I tried changing the path in the ammonite batch script itself, but every time I tried, something broke.我尝试更改菊石批处理脚本本身的路径,但每次我尝试时,都会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM