如何在代码中实现 Eclipse VM 参数
这可能是一个简单的问题,但我目前正在与 vlcj 合作为项目制作视频播放器.我有一个基本的播放器在工作,但只有当我有 VM 争论时才能使用
This is probably a simple question but I'm currently working with vlcj to make a video player for a project. I have a basic player working but only when I have the VM arguement
-Djna.library.path="C:\Program Files\VideoLAN\VLC"
在调试配置窗口中定义.我的问题是,如果我需要创建这个项目的一个版本以在 Eclipse 之外运行,我是否需要在我的代码中定义这个参数,或者我的程序是否会无限期地以这种方式运行而没有问题?
defined in the debug configurations window. My question is if I need to create a version of this project to run outside of Eclipse do I need to define this argument in my code or will my program run in this way without problems indefinitely?
感谢所有回答的人,
贾里德.
我认为
System.getProperties().setProperty("jna.library.path",
"C:\\Program Files\\VideoLAN\\VLC");
应该在这种特殊情况下用代码完成这项工作.-D
参数给 java
设置系统属性,最终在 System.getProperties()
中.
should do the job in code for this particular case. -D
arguments to java
set system properties, which end up in System.getProperties()
.