0

I have a question regarding adding several jar packages into Dynamic java path in Matlab. Having an instance of a java object (which is located in dynamic java path) I cannot add another jar package correctly.

For instance: If I have

  DYNAMIC JAVA PATH
   ~/yamlmatlab/trunk/external/snakeyaml-1.9.jar

and one instance coming from the package

yaml = org.yaml.snakeyaml.Yaml()

I cannot add another package correctly

>>javaaddpath('myJarAchive.jar'] );

Warning: Objects of org/yaml/snakeyaml/Yaml class exist - not clearing java

In javaclasspath>doclear at 379

In javaclasspath>local_javapath at 197

In javaclasspath at 119

In javaaddpath at 69

In RcSession>RcSession.RcSession at 80

The objects from 'myJarAchive.jar' cannot be instantiated then.. Has anybody seen how to overcome this problem?

Thank you,

Jiri

Jirka cigler
  • 405
  • 3
  • 6
  • I'm not sure, but if your JAR file contains the same yaml package, maybe you can extract the jar file (its a ZIP file after all), and selectively add the other classes you need.. – Amro Sep 18 '11 at 14:43

1 Answers1

0

I never got the 'dynamic classpath' in MATLAB working as expected. Use the ClassPathHacker as shown for eclipselink in order to add your jars dynamically.

Community
  • 1
  • 1
zellus
  • 9,617
  • 5
  • 39
  • 56