再次思考 classpath 环境变量 等

时间:2023-03-08 16:07:31

f:\aspectj1.8\lib\aspectjrt.jar;.;%JAVA_HOME%\lib;C:\Temp\IBM\SQLLIB\java\db2java.zip;C:\Temp\IBM\SQLLIB\java\db2jcc.jar;C:\Temp\IBM\SQLLIB\java\sqlj.zip;C:\Temp\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\Temp\IBM\SQLLIB\bin;C:\Temp\IBM\SQLLIB\java\common.jar;C:\Program Files (x86)\Java\jre1.8.0_25\lib\ext\QTJava.zip

E:\downloads\ff\ase-master\ase-master>set path=e:\java\jdk1.
8.0_20\bin;%path%

E:\downloads\ff\ase-master\ase-master>
E:\downloads\ff\ase-master\ase-master>java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

E:\downloads\ff\ase-master\ase-master>
E:\downloads\ff\ase-master\ase-master>GRADLE
:buildSrc:clean
:buildSrc:compileJava
:buildSrc:compileGroovy
startup failed:
E:\downloads\ff\ase-master\ase-master\buildSrc\src\main\groo
vy\org\ase\gradle\BuildPlugin.groovy: 44: unable to resolve class java
.time.ZoneOffset
@ line 44, column 1.
import java.time.ZoneOffset
^

E:\downloads\ff\ase-master\ase-master\buildSrc\src\main\groo
vy\org\ase\gradle\BuildPlugin.groovy: 45: unable to resolve class java
.time.ZonedDateTime
@ line 45, column 1.
import java.time.ZonedDateTime
^

2 errors

:buildSrc:compileGroovy FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileGroovy'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

Total time: 8.473 secs

E:\downloads\ff\ase-master\ase-master>set classpath
classpath=f:\aspectj1.8\lib\aspectjrt.jar;.;E:\Java\jdk7\lib;C:\Temp\IBM\SQLLIB\
java\db2java.zip;C:\Temp\IBM\SQLLIB\java\db2jcc.jar;C:\Temp\IBM\SQLLIB\java\sqlj
.zip;C:\Temp\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\Temp\IBM\SQLLIB\bin;C:\Tem
p\IBM\SQLLIB\java\common.jar;C:\Program Files (x86)\Java\jre1.8.0_25\lib\ext\QTJ
ava.zip

搜索得知 ZonedDateTime 的jdk 8的类, 估计也是。。 于是使用jdk8吧
E:\downloads\ff\ase-master\ase-master>set classpath=e:\java\
jdk1.8.0_20\lib

软件直接读取 JAVA_HOME ? 我 JAVA_HOME 设置的原因?

E:\downloads\ff\ase-master\ase-master>set JAVA_HOME=E:\Java\
jdk8\

E:\downloads\ff\ase-master\ase-master>mvn

Error: JAVA_HOME is set to an invalid directory.
JAVA_HOME = "E:\Java\jdk8\ "
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

晕... 目录是确实存在的 , 为什么说 invalid ?

我去, 最后, 只能退出cmd, 从电脑属性 - 设置环境变量了, 重新设置 JAVA_HOME 为 8 后, 问题解决!