0

I have a Java code to call two MATLAB jobs. The first job is to set the java class path by using javaaddpath to include the jdbc driver jar. The second job is to read data from database. The first job is executed successfully. But the second job can't pick up the class path that the first job sets. If I print out java classpath using javaclasspath('-all'), the jdbc driver jar is not there. Can the javaaddpath setting cross the global java jobs?

I'm using MATLAB AND MCR 2012a. Thanks!

Amro
  • 123,847
  • 25
  • 243
  • 454
lijie98
  • 617
  • 1
  • 6
  • 13
  • have you read this: [How do I set the Java classpath for stand-alone applications created using MATLAB Compiler?](http://www.mathworks.com/support/solutions/en/data/1-1ZDC5P/index.html?solution=1-1ZDC5P)? Also this might be relevant: [Matlab Compiler MCC errors on imports for Java classes from dynamic Java classpath](http://stackoverflow.com/q/9220675/97160) – Amro Jun 29 '12 at 16:53

1 Answers1

0

Using a static classpath solves many problems that usually occurs when using dynamic classpath.

Now when you deploy a MATLAB application, you could manually place a custom classpath.txt file in the application deployement folder.

Amro
  • 123,847
  • 25
  • 243
  • 454
  • I ever considered this solution. But for different application, the loaded jars may be different. That's why I want to use dynamic classpath – lijie98 Jun 29 '12 at 17:43