Borrar filtros
Borrar filtros

Using MATLAB (Windows) generated Java package in Linux

2 visualizaciones (últimos 30 días)
As far as I know, I can run .mex files on Linux that were generated on Windows by installing Matlab Runtime on Linux (correct me if I am wrong). But what if I want to use a MATLAB generated java package, that was generated on Windows, on a Linux (like Ubuntu)?
Objective:
I have to test a feature that uses audio processing. If test is successful, we will buy the products we need. At the moment I have my requested license on Windows, since the requested license have machine specific limitation, I am able to generate some test java code on my Windows machine, now the application is to be deployed on android, so I learnt from google that it needs matlab runtime to run or compiler to use converted/generated code. Android system has no MCR or simple Matlab Runtime installation support, so I moved to this solution.
Use a linux to host servlet that takes some input from android, do processing return answer in terms of json or text. Now my java package is generated using Windows machine, and I am lost.
From my knowledge this code-convert-servlet-deploy-once approach is easier than using MATLAB Production Server, also we do not have very time/power consuming tasks. We will move to standard license when the tests are successful and this approach is giving us desired results.
Specs:
Windows 10
MATLAB 2016a (Trial)
MATLAB products (Compiler/sdk, Signal Processing/Audio Processing Toolbox)
Package made using JDK 1.7.x (Exactly matching MATLAB jdk/jre version on Windows)
Ubuntu 16 Desktop (with Oracle jdk 8_101 installed, also MATLAB Runtime installed, I can also work with jdk 7.x (same as MATLAB used on Windows when generating package))
Questions:
- How can I use this java package in Linux when I create a java program?
- What software + licenses are needed to make it possible?
- Should I install MATLAB ON Linux machine, generate Java Package ON Linux machine and use that package in java program ON same linux machine? ( I think I will need to request license for it again )
- Are there any other methods? Am I missing something?

Respuesta aceptada

Talha  Hasan Zia
Talha Hasan Zia el 5 de Sept. de 2016
What I was doing was wrong way to do things as describe in this post . I also got reply from MATLAB Support Team.
FROM MATLAB SUPPORT
JARs generated using Builder JA are generally platform independent, only if they do not use MEX files internally (as those are platform dependent). So it may be possible for you to use a Java package (jar file) in Linux platform that was originally created in the Windows platform if it does not use mex files and other toolbox functions that are OS-dependent.
Also, it is necessary for you to download the correct version of MATLAB Compiler Runtime for your Linux platform. Please refer the following link for more information.
For your question related to verifying whether MCR is installed, we just need to check the directory structure and verify if the path to MCR libraries is prepended to the "LD_LIBRARY_PATH" environment variable. The path described in MATLAB R2016a documentation is correct. Here, "matlabroot" stands for the root folder where the matlab files are installed and corresponds to a location depending on where you installed MCR on your system.
I suggest you to try compiling a simple program like magic square on the Windows platform and test this on the Linux platform using a driver program that calls the jar file. This will also help you verify if MCR is functioning correctly.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by