matlab java类路径问题 [英] matlab java class path issue

查看:765
本文介绍了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.

这是我有什么


javaaddpath('C:\exchsys\jars\exsystools.jar')
javaaddpath('C:\exchsys\externaljars\\ \\ log4j.jar')
javaaddpath('C:\exchsys\externaljars\')
javaaddpath('C:\apache-activemq-5.1.0\lib\commons- logging-1.1.jar')

javaaddpath('C:\apache-activemq-5.1.0\activemq-all-5.1.0.jar')

javaaddpath('C:\exchsys\jars\exsystools.jar') javaaddpath('C:\exchsys\externaljars\log4j.jar') javaaddpath('C:\exchsys\externaljars\') javaaddpath('C:\apache-activemq-5.1.0\lib\commons-logging-1.1.jar')
javaaddpath('C:\apache-activemq-5.1.0\activemq-all-5.1.0.jar')

加上我的实际代码

这会导致以下错误:
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


javaaddpath('C:\exchsys\externaljars\' )

javaaddpath('C:\exchsys\externaljars\')

当我将相同的路径放入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类路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆