English 中文(简体)
如何在代码中应用日食 VM 参数
原标题:How to implement an eclipse VM argument in code

这或许是一个简单的问题, 但我目前正在与 vlcj 合作, 为一个项目制作一个视频播放器。 我有一个基本的播放器在工作, 但只有在我有 VM 参数时才工作 。

-Djna.library.path="C:Program FilesVideoLANVLC"

调试配置 窗口定义的调试配置 。 我的问题是, 我是否需要创建此工程的版本, 以在日光窗之外运行 。 我是否需要在我的代码中定义这个参数? 还是我的程序会以这种方式运行而不出现任何问题?

感谢所有回答者,

贾里德

最佳回答

我觉得

System.getProperties().setProperty("jna.library.path",
  "C:\Program Files\VideoLAN\VLC");

是否应该为此特定案例执行代码中的工作 。 - D 参数到 java 设置系统属性,这些属性最终在 System.getPropertys () 中。

问题回答

您无法在运行时设置 JVM 参数, 如果您要导出您的工程, 您将不得不另找方法来完成它: 这是通过在脚本文件中包装执行您的程序而完成的, 让它成为 < code>.bat 或 < code>.sh , 这样您就可以使用设置的参数来引用 java 执行文件 。

我猜你是在说 在日出外执行这个计划吧





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签