1

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"

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?

Thanks to anyone who answers,

Jared.

2 Answers 2

8

I think

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

should do the job in code for this particular case. -D arguments to java set system properties, which end up in System.getProperties().

Sign up to request clarification or add additional context in comments.

Comments

0

You can't set JVM arguments at runtime, if you are going to export your project you'll have to find another way to do it: this is done by wrapping the execution of your program within a script file, let it be a .bat or .sh so that you can invoke the java executable with your paramters set.

I'm assuming you are talking about executing the program outside Eclipse.

3 Comments

Yes I'm talking about running the program outside of eclipse. Would you be able to tell me the key words I would need to use to research information on how to implement this?
Basically we're talking about embedding jvm arguments, although there is no direct way to do it (even inside a .jar)
You can't set general JVM arguments at runtime, but I wonder if you can set these. I was under the impression that -D arguments just went into System.getProperties().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.