Bug 233342

Summary: org.lwjgl.LWJGLException: Could not locate OpenAL library.
Product: java Reporter: Andre_Lopes_2012
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: RESOLVED WONTFIX QA Contact: issues <issues.netbeans.org>
Priority: P3 CC:
Version: 7.4   
Target Milestone: 7.4   
Hardware: PC   
OS: Windows 7 x64   
URL: http://www.youtube.com/watch?v=rMtMBR1Cfn8
Whiteboard:
Issue Type: DEFECT Exception Report:
Attachments: Log do IDE
Here is the project for the test that was required. Plus the Jglfw Library and the other libraries.
Screenshot
Running without exception

Description Andre_Lopes_2012 2013-07-24 18:24:09 UTC
Exception when using libgdx.
org.lwjgl.LWJGLException: Could not locate OpenAL library.

It doesnt happen with Eclipse.

Video Showing the Error : http://www.youtube.com/watch?v=rMtMBR1Cfn8


Product Version = NetBeans IDE 7.4 Beta (Build 201307092200)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_21
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Comment 1 Andre_Lopes_2012 2013-07-24 18:24:12 UTC
Created attachment 137729 [details]
Log do IDE
Comment 2 Andre_Lopes_2012 2013-07-24 18:24:34 UTC
The video explains everything.
http://www.youtube.com/watch?v=rMtMBR1Cfn8
Comment 3 Andre_Lopes_2012 2013-07-25 19:10:16 UTC
Post i made regarding that issue.

http://www.java-gaming.org/topics/netbeans-7-4-still-bugs-with-libgdx-video/30228/view.html


Some users/Developers came with ideas.
Comment 4 Tomas Zezula 2013-07-26 07:22:32 UTC
The problem is in loading the native library by OpenAL not with the IDE. You need to either set up environment variables correctly or set the OpenAL library.

If you attach a self contained test project (J2SEApplication with per project libraries) showing the problem I will look how the OpenAL old the library and help.
Comment 5 Andre_Lopes_2012 2013-07-26 20:54:40 UTC
Created attachment 137883 [details]
Here is the project for the test that was required. Plus the Jglfw Library and the other libraries.

Here is the project for the test that was required.
Plus the Jglfw Library and the other libraries.
Comment 6 Andre_Lopes_2012 2013-07-26 20:55:23 UTC
(In reply to comment #4)
> The problem is in loading the native library by OpenAL not with the IDE. You
> need to either set up environment variables correctly or set the OpenAL
> library.
> 
> If you attach a self contained test project (J2SEApplication with per project
> libraries) showing the problem I will look how the OpenAL old the library and
> help.

Attached. 
Plus, JGO was told about this. So they may come assist!
Comment 7 Tomas Zezula 2013-07-29 17:10:48 UTC
I've updated the test project to be self contained, it can be downloaded from https://dl.dropboxusercontent.com/u/79648505/JavaProject1.zip
Comment 8 Andre_Lopes_2012 2013-07-29 17:14:21 UTC
(In reply to comment #7)
> I've updated the test project to be self contained, it can be downloaded from
> https://dl.dropboxusercontent.com/u/79648505/JavaProject1.zip

I Appreciate Tomas. I will have to do a College presentation to all Science classes with this project/ library. SO its very important to me and to Netbeans that it doesnt show that bug in front of everyone.
Comment 9 Tomas Zezula 2013-07-29 17:25:46 UTC
On Mac both the:

JglfwApplication jglfwApplication = new JglfwApplication(new MyGdxGame(),"",480,320,true);

and the:

LwjglApplication lwjglApplication = new LwjglApplication(new MyGdxGame(), "", 480, 320, true);

works fine, the empty window is opened and no exception is reported. I will attach an image.
Unfortunately I have no Windows with OpenGL support, just a virtual machine.
I will ask someone with real Windows Machine to try tomorrow.

Is my expectation that the:

LwjglApplication lwjglApplication = new LwjglApplication(new MyGdxGame(), "", 480, 320, true);

should fail correct? Or do I need something more to get the exception?
Comment 10 Tomas Zezula 2013-07-29 17:26:31 UTC
Created attachment 137957 [details]
Screenshot
Comment 11 Tomas Zezula 2013-07-29 17:29:28 UTC
One more question:
Are you using the same library and JDK when you run the application in NetBeans and Eclipse?
There may be 32/64 architecture problem on Windows, the Mac is 64bit only.
Comment 12 Andre_Lopes_2012 2013-07-29 17:48:43 UTC
Oh yes, im using same library, same classes.
And you have to use LwjglApplication lwjglApplication indeed.

It seems it only happens in some systems, might be some Country-issue ?

My Windows is a BR win7 64 bit version,jdk 64 bit u25 , jre u25 64bit as well.

It shows up, like in the youtube video, but it gives the exception.It runs well, but shows the Exception.
Comment 13 Tomas Zezula 2013-07-29 18:01:40 UTC
I've found http://code.google.com/p/libgdx/issues/detail?id=1419

The important part is:
>Not sure what we can do about that. The native libraries are in the gdx-backend-lwjgl-natives.jar. If >that's in your classpath, then libgdx will load the shared libraries manually. It looks as though that jar is >not in your classpath when you execute the app.

The classpath can be easily verified  by setting the Tools/Options/Java/Ant/Verbosity Level to debug.
The output will contain lots of messages including the exact command to launch the JVM.
Can you attach the Ant/Verbose output.

Another important part is:
> I use IntelliJ IDEA,and found the same Exception!
According to this it does not seem to be NetBeans issue, it seems rather libgdx issue. I am not sure how reliable is the manual load of shared libs in libgdx.
Attaching the Ant verbose output will show.
Thanks
Comment 14 Tomas Zezula 2013-07-29 18:45:06 UTC
Seems that OpenAL initialisation is not very stable on on Windows: http://lwjgl.org/forum/index.php?topic=3253.0
Comment 15 Andre_Lopes_2012 2013-07-29 18:54:10 UTC
Hm, i will send this to JGO Post.
Comment 16 Roman Svitanic 2013-07-30 08:15:42 UTC
Created attachment 137983 [details]
Running without exception

I have tried attached project on Windows 7 x64, JDK 7u25, NetBeans Dev. As you can see from attached screenshot, application compiles fine and runs OK.
Comment 17 Tomas Zezula 2013-07-30 11:35:26 UTC
Roman has tested the libgdx on Windows and it works also fine, it seems as some  race in libgdx.
Anyway the problem is in libgdx not in NetBeans which correctly launches the application with correct classpath as seen in and debug:

Executing '/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/bin/java' with arguments:
'-Dfile.encoding=UTF-8'
'-classpath'
'/Users/tom/Downloads/JavaProject1/lib/gdx-backend-lwjgl-natives.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-backend-lwjgl-sources.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-backend-lwjgl.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-natives.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-sources.jar:/Users/tom/Downloads/JavaProject1/lib/gdx.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-backend-jglfw-natives.jar:/Users/tom/Downloads/JavaProject1/lib/gdx-backend-jglfw.jar:/Users/tom/Downloads/JavaProject1/build/classes'
'com.me.mygdxgame.Main'

All native jars are on runtime classpath. The problem has to be solved in libgdx.

If you don't need audio you can use:

LwjglApplicationConfiguration.disableAudio = true;

which may help as the OpenAL will not be initialised.
Comment 18 Andre_Lopes_2012 2013-08-03 13:28:32 UTC
Doesnt happen in Eclipse.. I cant bealive i will have to betray netbeans... 

Well, at least i will be able to use sound.
Comment 19 Tomas Zezula 2013-08-05 16:55:30 UTC
<cite>
If that's in your classpath, then libgdx will load the shared libraries manually.
</cite>
IDE correctly launches the app with OpenAL library on classpath as seen & explained above.
That it does not happen in Eclipse but happens in Idea (Swing based IDE) may be a timing issue or the DSP can be already initialised or whatever, it's a problem of the OpenAL. You should solve the problem in OpenAL bugzilla.
Comment 20 Andre_Lopes_2012 2013-08-05 16:57:55 UTC
Roger!
Do you have a link for the openAL Bug report? I will be sure to report this!

Thanks for the help!
Comment 21 Tomas Zezula 2013-08-05 17:10:30 UTC
As seen in comment #7:
>I have tried attached project on Windows 7 x64, JDK 7u25, NetBeans Dev. As you
>can see from attached screenshot, application compiles fine and runs OK.
Works also with NB, probably depending on timing as described on thread attached above. This is an another proof that the problem is in OpenAL library.
The thread describes both the problem with NULL hwnd and also some kind of workaround of the problem (waiting for the non NULL handle) which you may try when you need the sound.
Comment 22 Andre_Lopes_2012 2013-08-21 19:18:40 UTC
Tomas, i fixed it by doing this :

System.setProperty("user.name","EnglishWords");
      
Application lpp = new LwjglApplication(listener, title, width, height,useOpenGLES2);

The bug doesnt happen anymore.

Just using that property, would you have a look again please?
Comment 23 Tomas Zezula 2013-08-30 06:27:27 UTC
The user.name property is set by the JVM when it's created. As seen in the comment #17 the only property passed by the IDE to the JVM is file.encoding which is set to the value specified in the Project Properties/Sources/Source Encoding.
The problem is in OpenAL (according to docs the only requirement is presence on classpath which is fulfilled). I will need to debug the OpenAL to find out what's the root cause unfortunately I have neither time for it nor Windows with C/C++ dev kit. You need to report it to OpenAL.
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo