Adding jars to matlab

23 visualizaciones (últimos 30 días)
Jason
Jason el 24 de Sept. de 2015
Comentada: Jason el 29 de Sept. de 2015
I have two computers. Computer A has matlab on and I use to write GUI's and then compile them. Computer B has hardware attached and 3rd party open source software. In order to allow matlab to run the 3rd party, I need to add a few jar files to the class path. Walter has kindly showed me to use e.g.:
javaaddpath(C:/Micro-Manager-1.4/plugins/Micro-Manager/MMCoreJ.jar','-end')
But, my Computer A does not have these jar files on, these belong only on Computer B. Computer B also does not have matlab, but does have the MCR, so I want to use computer A to compile my matlab GUI to run on computer B, but to use the jar files from Computer B (associated with the open source program)
So does using the code above, on Computer A (where there are no jars), allow my GUI, when compiled and run on computer B to include these jars. Is there a better way to ensure the compiled code has access to the jars?
Sorry if this is confusing.
Thanks Jason

Respuesta aceptada

Dasharath Gulvady
Dasharath Gulvady el 28 de Sept. de 2015
Editada: Dasharath Gulvady el 28 de Sept. de 2015
Jason,
You may achieve this by adding the JAR file only for compiled applications, which can be done using "isdeployed" as follows:
if isdeployed
javaaddpath('C:/Micro-Manager-1.4/plugins/Micro-Manager/MMCoreJ.jar','-end')
end
This makes sure that the JAR file is added in machine B and not in machine A.
  6 comentarios
Jason
Jason el 29 de Sept. de 2015
Do you mean "Files Required for your application to run" as I am making a standalone .EXE

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB Compiler en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by