Jump to content
Excelsior Forums
Jinnuse

jvlc and jet

Recommended Posts

Hi. I uses Jet v6.4 Professional Edition.

In my application i use jvlc library. This is bridge from java to vlc video player core. jvlc.jar loads jvlc.dll. But cause of problem is jvlc.dll loads jawt.dll. When i run my compiled by jet application it hung. I checked jvlc.dll by some application and noticed that it can't find jawt.dll. I tried to load jawt.dll from folder rt/bin inside my application but it threw exception: "already loaded by some other classloader".

Then i copied jawt.dll, java.dll, awt.dll,jvm.dll from rt/bin to root folder of my app. I did it with JetPack II by adding jawt.dll,java.dll,awt.dll,jvm.dll to root folder of application. Now my installed application works correctly but i think that it is wrong way because it raised setup size and size folder of installed application.

Can you help me?

Share this post


Link to post
Share on other sites
I checked jvlc.dll by some application and noticed that it can't find jawt.dll. I tried to load jawt.dll from folder rt/bin inside my application but it threw exception: "already loaded by some other classloader".

That's right because you do not have to load it from Java code (JVLC loads it from native code).

Then i copied jawt.dll, java.dll, awt.dll,jvm.dll from rt/bin to root folder of my app. I did it with JetPack II by adding jawt.dll,java.dll,awt.dll,jvm.dll to root folder of application.

That's not perfectly legal as files from /rt folder should not be selectively copied.

I would recommend you to check how JVLC loads the dll.

If it simply calls LoadLibrary("jawt.dll"), that is a hack exploiting the fact that "java.exe" and "jawt.dll" resides in the same folder and Windows (in particular) looks for DLLs in the folder containing the executable which established the process ("java.exe" in case of JRE).

A more reliable way would be detecting the JRE home folder and appending the relative path to  jawt.dll

Share this post


Link to post
Share on other sites

The problem is jvlc doesn't load jawt.dll directly. jvlc.jar loads jvlc.dll and then jvlc.dll loads jawt.dll. I can't get source code of jvlc.dll to change the way it loads jawt.dll. When i use native java then jvlc.dll can find jawt.dll because installer of sun java adds path of jre/bin to system's variable path(i mean windows).

Myabe there is some way to configure JetPackII so it will add rt/bin to system's variable path like sun's java?

As i understand when jvlc.jar load jvlc.dll then jvlc.dll looking for jawt.dll using system's variable path or using search in current folder.

Thank you for attention.

Share this post


Link to post
Share on other sites

If nothing else helps, you may do the trick (hack) used by the JVLC authors:  copy jawt.dll into the same directory where the JET-compiled executable resides and it will start working like a charm.

In your position, I would also file a complaint (issue, bug report, you name it) to the JVLC dev team.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×