How to I enable java through matlab command line?

How to I enable java through matlab command line?

5 Kommentare

Ron Aditya
Ron Aditya am 25 Jun. 2018
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?
OCDER
OCDER am 25 Jun. 2018
how are you starting matlab? Are you using matlab -nojvm?
Ron Aditya
Ron Aditya am 25 Jun. 2018
I am using:
matlab -nojvm -nosplash -c 1611\@svllic-matlab.xxx.yyyy.com
OCDER
OCDER am 25 Jun. 2018
Ah, so what do you think "-nojvm" option means? See edited answer below.
Ron Aditya
Ron Aditya am 25 Jun. 2018
I used matlab -nodesktop and it worked. Thanks!

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

OCDER
OCDER am 25 Jun. 2018
Bearbeitet: OCDER am 25 Jun. 2018

0 Stimmen

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([])

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2007a

Gefragt:

am 25 Jun. 2018

Kommentiert:

am 25 Jun. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by