本文介绍了matlab java类路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将classpath放入静态类路径(即将它们放在classpath.txt文件中)程序工作。当我动态地添加它,我得到一个错误,它找不到类路径中的属性文件。

When I put classpaths into the static class path (ie put them in the classpath.txt file) program works. When I add it dynamically, I get an error that it can't find a properties file in the class path.

这是我有什么

加上我的实际代码

这会导致以下错误:
javax.naming.ConfigurationException: JMSUtilities.loadConfiguration():类路径中找不到属性文件/exsysjms.properties。

This leads to the following error:javax.naming.ConfigurationException: JMSUtilities.loadConfiguration(): Properties file "/exsysjms.properties" not found in the classpath.

它正在寻找的文件是通过此行添加的文件夹

The file it is looking for is a in the folder added through this line

当我将相同的路径放入classpath.txt文件中时,工作正常。任何想法?

When I put the same paths into the classpath.txt file it works fine. Any ideas?

推荐答案

您在静态 vs 动态类路径 。此问题的解决方法在中显示,方法是使用 ClassPathHacker.java 为了动态加载java类。您还可以查看其他响应以获取更多信息。

Your experiencing issues concerning static vs dynamic classpath. A workaround for this issue is shown in this post by using ClassPathHacker.java in order to dynamically load java classes. You may check the other responses as well for further information.

这篇关于matlab java类路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 10:56