How to I enable java through matlab command line?

How to I enable java through matlab command line?

댓글 수: 5

I am opening Matlab as command line only on on a Unix machine. 'ver' gives me the following output. See that java is not enabled.
If I open the Matlab GUI , "ver" gives me the following. note that java is enable in this case.
I am using the following command:
unitMap = java.util.Hashtable;
It runs fine when the Matlab GUI is opened as java is enabled by default.
But I get the following error when I run it on Matlab opened as command line only as java is not enabled:
Here:
How should I enable java?
how are you starting matlab? Are you using matlab -nojvm?
I am using:
matlab -nojvm -nosplash -c 1611\@svllic-matlab.xxx.yyyy.com
Ah, so what do you think "-nojvm" option means? See edited answer below.
I used matlab -nodesktop and it worked. Thanks!

댓글을 달려면 로그인하십시오.

 채택된 답변

OCDER
OCDER 2018년 6월 25일
편집: OCDER 2018년 6월 25일
NEW ANSWER
Start matlab without "-nojvm". "nojvm" means no java virtual machine.
OLD ANSWER
Import the java libraries you want to use. Here's an example:
import javax.swing.JFileChooser
A = JFileChooser;
A.showOpenDialog([])

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2007a

질문:

2018년 6월 25일

댓글:

2018년 6월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by