如何禁用Windows平台上的JVM运行背景MATLAB脚本 [英] How can I disable the JVM on a Windows platform for running background matlab scripts

查看:228
本文介绍了如何禁用Windows平台上的JVM运行背景MATLAB脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里找到了类似的问题,这并不能帮助我,所以我问我自己。
我有一个MATLAB脚本,linux下完全可与nohup命令。
不幸的是,我需要在Windows上运行谓也。但我不明白为什么我的命令仍然无法正常工作。
我的脚本执行一定的循环,但后先停止给我有关Java什么错误。我必须告诉你,在linux下发生同样的问题,如果我不把 -nodisplay 命令。

我的批次线以下

的matlab -nodisplay - 自动化-r运行('myfile.m')-logfile output.txt的-minimize

请帮我。

编辑:
我想我找到了我的问题,问题是,当我使用 -nodisplay linux下的命令 usejava('AWT')工作,因为我的Java环境中被禁用,但是这并没有windows下发生!为什么呢?

第二个编辑:
我想我找到的东西是非常相似的,我需要的东西。

  MATLAB -noawt -noFigureWindows -r运行('myfile.m')-logfile output.txt的-minimize

分析运行,没有说什么,但在MATLAB命令窗口依然打开minimized..uhm
我宁愿有什么开拓!

我必须,但使用任何其他批处理命令添加其他的东西.. 的nohup 永远等待和前进,直到到达脚本的结尾,例如启动如果有任何输入请求或等待停止,直到有人给输入!


解决方案

未公开的 -noawt 选项prevent GUI功能,但让Java运行。再加上 -noFigureWindows ,因为你发现,你应该有你需要的东西。另外,您也可以通过您的M档关闭图形显示与设置(0,'DefaultFigureVisible','关闭')

要看看Java的实际加载,运行版本版本-java 。这是我看到 -nojvm

然后,使用Windows启动/ B /分钟MATLAB.exe ... 应该启动它最小化,并没有抱着一​​个命令窗口中打开。

为使MATLAB的无形尝试使用微小的的NirCmd 命令行工具有:

  nircmd.exe EXEC隐藏Win64的\\ MATLAB.exe -noawt -noFigureWindows -nosplash -minimize ...

我觉得应该这样做,请确认您开始实际 MATLAB.exe 斌\\ &LT;建筑GT; 文件夹,而不仅仅是斌\\ matlab.exe ,因为当它启动实际mATLAB.exe,它不会被隐藏<。 / p>

I found a similar question here that doesn't help me so I'm asking my own. I have a matlab script that perfectly works under linux with nohup command. Unfortunately, I need to run that on windows also. But I can't understand why my command still doesn't work. My script does a certain loop but after the first it stops giving me an error about the java or something. I must tell you that the same problem occur under linux if I don't put the -nodisplay command.

My batch line is the following

matlab -nodisplay -automation -r "run('myfile.m')" -logfile output.txt -minimize

Please help me.

edit: I think I found my issue the problem is when I use -nodisplay under linux the command usejava('awt') works because my java environment is disabled, however this does not happen under windows! Why?

second edit: I think I found something that is quite similar to what I needed.

matlab -noawt -noFigureWindows -r "run('myfile.m')" -logfile output.txt -minimize

The analysis runs, without saying nothing, but the MATLAB command window still opens minimized..uhm I'd rather having anything to open up!

I must add another thing..nohup never waits and go forward until it reaches the end of the script, nevertheless using any other batch command such as start if there is any input request or "wait" it stops until someone gives an input!

解决方案

The undocumented -noawt option will prevent the GUI functionality, but let Java run. Combine that with -noFigureWindows, as you discovered, and you should have what you need. Alternatively, you can turn off figure display via your M file with set(0,'DefaultFigureVisible','off').

To see if Java actually loaded, run ver or version -java. Here's what I see with -nojvm.

Then, using Windows' start /b /min MATLAB.exe ... should launch it minimized and without holding a command window opened.

To make MATLAB invisible try using the tiny NirCmd command line tool as follows,

nircmd.exe exec hide win64\MATLAB.exe -noawt -noFigureWindows -nosplash -minimize ...

I think that should do it, but make sure you start the actual MATLAB.exe in the bin\<architecture> folder, not just bin\matlab.exe because when it launches the actual MATLAB.exe, it will not be hidden.

这篇关于如何禁用Windows平台上的JVM运行背景MATLAB脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆