java class jar 的加载问题

本文解决了Java应用中出现的ClassNotFoundException问题,特别是针对找不到org.slf4j.LoggerFactory类的情况。提供了两种解决方案:一种是将必要的JAR文件添加到所有Java应用都能访问的位置/Library/Java/Extensions;另一种是仅对特定用户的应用生效,即将文件放置在~/Library/Java/Extensions目录。

遇到了报错:

Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

 

后面在stackoverflow上面找到了答案

If you want to make a certain set of JAR files (or .class files) available to every Java application on the machine, then your best bet is to add those files to /Library/Java/Extensions.

Or, if you want to do it for every Java application, but only when your Mac OS X account runs them, then use ~/Library/Java/Extensions instead.

EDIT: If you want to do this only for a particular application, as Thorbjørn asked, then you will need to tell us more about how the application is packaged.

转载于:https://www.cnblogs.com/mahong-shaojiu-ruby/p/6008130.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值