0

Does java_import always execute before initialize in JRuby?

I need the following code to execute

def initialize vlc_path
    @vlc_path = vlc_path || get_vlc_path
    NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName,"/Applications/VLC .app/Contents/MacOS/lib")
end

before I can use:

java_import 'uk.co.caprica.vlcj.binding.LibVlc'

The java_import always executes first and fails. How to go about it?

1 Answer 1

1

Methods get called when they get … well … called. If you call initialize before you call java_import it will execute first, if you call it after java_import it will execute after java_import.

If you want to call initialize before you call java_import, you need to call initialize before you call java_import.

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

Comments

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.