Compiling Java Client Application

Hi all,
I am trying to follow the example listed here and I am trying to compile the java file using javac. Following the example, I am running
javac -classpath "matlabroot\toolbox\compiler_sdk\mps_clients\java\mps_client.jar" MPSClientExample.java
where matlabroot is the Matlab installed folder.
I am having the following error message, that suggests I am not linking the classpath properly. I am sure the path to the mps_client.jar is correct and that the file is the folder, but I don't know how to fix the error. Any idea?
Thank you in advance.
MPSClientExample.java:3: error: package com.mathworks.mps.client does not exist
import com.mathworks.mps.client.MWClient;
^
MPSClientExample.java:4: error: package com.mathworks.mps.client does not exist
import com.mathworks.mps.client.MWHttpClient;
^
MPSClientExample.java:5: error: package com.mathworks.mps.client does not exist
import com.mathworks.mps.client.MATLABException;
^
MPSClientExample.java:10: error: cannot find symbol
throws MATLABException, IOException;
^
symbol: class MATLABException
location: interface MATLABAddMatrix
MPSClientExample.java:20: error: cannot find symbol
MWClient client = new MWHttpClient();
^
symbol: class MWClient
location: class MPSClientExample
MPSClientExample.java:20: error: cannot find symbol
MWClient client = new MWHttpClient();
^
symbol: class MWHttpClient
location: class MPSClientExample
MPSClientExample.java:31: error: cannot find symbol
}catch(MATLABException ex){
^
symbol: class MATLABException
location: class MPSClientExample
7 errors

4 件のコメント

Kojiro Saito
Kojiro Saito 2019 年 10 月 23 日
mps_client.jar seems to be not included properly. What is an exact javac command? What full path of matlabroot?
Magda Guglielmo
Magda Guglielmo 2019 年 10 月 23 日
Hi Kojiro,
thanks for the reply the exact javac command (with the full path to matlabroot) is
javac -classpath "C:\Program Files\MATLAB\R2018B\toolbox\compiler_sdk\mps_clients\java\mps_client.jar" MPSClientExample.java
Thanks again for your help
Magda
Kojiro Saito
Kojiro Saito 2019 年 10 月 24 日
What is your JDK version? You can find your JDK version from Commamd Prompt.
java -version
Magda Guglielmo
Magda Guglielmo 2019 年 10 月 27 日
Hi Kojiro,
Thank you for your time. The Matlab java (in Matlab Command prompt) is
Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
while from Command Propt
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2019 年 10 月 23 日

コメント済み:

2019 年 10 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by