如何在代码中实现 Eclipse VM 参数 [英] How to implement an eclipse VM argument in code

查看:32
本文介绍了如何在代码中实现 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().

这篇关于如何在代码中实现 Eclipse VM 参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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