I have the following lines in my MATLAB code:
javaaddpath('C:\Users\localadmin\SkyDrive\IdeaProjects\DrawModels\out\artifacts\DrawModels_jar\DrawModels.jar') javaaddpath('C:\Users\localadmin\SkyDrive\IdeaProjects\DrawModels\out\artifacts\DrawModels_jar\itextpdf-5.4.1.jar') I then go on to instantiate some JAVA objects defined in the files.
I would like to copy the JAR files to where the .m file sits, and then write the following instead (i.e. I want to use a relative path rather than an absolute one).
javaaddpath('DrawModels.jar') javaaddpath('itextpdf-5.4.1.jar') However, the MATLAB path doesn't seem to apply to javaaddpath and so the JAR files do not get loaded.
Any ideas as to how I may achieve a relative path addressing of JAR files?
The background for this is I want the MATLAB code to run both on Windows and Linux, i.e. whereever it is unpacked. The user may unpack it in any folder he chooses, so I don't want a hard-coded path in the source.
Any help appreciated.