You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotnet-learn-vs/WebMVC/WebMVCApi/md/java 编译打包过程中 找不到 tools.jar ...

16 lines
895 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
icon: edit
date: 2023-02-19
category:
- 系统配置
- Java
headerDepth: 5
---
# java 编译打包过程中 找不到 tools.jar 的问题,终结解决
> jdk 1.8 中有个tools.jar里面提供了很多便于开发的工具但是由于其是在sun 工作接管Java是开发的不受到甲骨文公司的欢迎在后续的版本中已经移除了tools.jar 所以之后的Java配置环境变量的时候已经不再配置CLASSPATH 了
> 但是有时候在开发中用到tools.jar 的时候,发现在编译过程中 javac 命令是不会去读取CLASSPATH 的jar 去编译的, 网上有好多解决方法放到jre 的lib 里面但是问题无法解决的
> 因为是sun 公司开发的oracle 在引用的这些jar的时候是当作扩展去加载的
只要把tools.jar 放入 jre目录lib 下的ext 扩展类目录就可以在Javac 编译是加载读取