Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Let's build a game on Youtube

 
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I am copying a game Let 's Build to Game on YouTube from Realtutsgml of the video 11
I have trouble installing Lwjgl, I wonder if I have downloaded
In any case when I compile, I have a mistake that I do not understand
Thank you for your help

Fri Aug 13 10:13:58 CEST 2021 INFO:Initialising sounds..
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path: C:\Program Files\Java\jdk-16.0.1\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Users/ronald/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955/jre/bin/server;C:/Users/ronald/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.2.v20210201-0955/jre/bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\ronald\AppData\Local\Microsoft\WindowsApps;;C:\Users\ronald\eclipse\java-2021-03\eclipse;;.
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2423)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:808)
at java.base/java.lang.System.loadLibrary(System.java:1893)
at org.lwjgl.Sys$1.run(Sys.java:72)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:87)
at org.lwjgl.Sys.<clinit>(Sys.java:117)
at org.lwjgl.openal.AL.<clinit>(AL.java:59)
at org.newdawn.slick.openal.SoundStore$1.run(SoundStore.java:295)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at org.newdawn.slick.openal.SoundStore.init(SoundStore.java:292)
at org.newdawn.slick.Sound.<init>(Sound.java:83)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:20)
at com.tutorial.main.Game.<init>(Game.java:42)
at com.tutorial.main.Game.main(Game.java:183)
 
Master Rancher
Posts: 4465
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path:


That is an execution error, not a compile error.
The JVM can not find the lwjgl64.dll (Not sure on extension of dll) file on the path.  Do you have that file?  Where is it located?
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this file
It is installed in another SLICK folder
so I added lwjgl and slick in java build path but I do not have sounds
This is what the console indicates

Fri Aug 13 22:06:25 CEST 2021 INFO:Initialising sounds..
Fri Aug 13 22:06:25 CEST 2021 ERROR:Sound initialisation failure.
Fri Aug 13 22:06:25 CEST 2021 ERROR:sealing violation: package org.lwjgl.openal is sealed
java.lang.SecurityException: sealing violation: package org.lwjgl.openal is sealed
at java.base/jdk.internal.loader.BuiltinClassLoader.getAndVerifyPackage(BuiltinClassLoader.java:899)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineOrCheckPackage(BuiltinClassLoader.java:870)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.defineOrCheckPackage(ClassLoaders.java:205)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:842)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:753)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:676)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:634)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
at org.newdawn.slick.openal.SoundStore$1.run(SoundStore.java:295)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at org.newdawn.slick.openal.SoundStore.init(SoundStore.java:292)
at org.newdawn.slick.Sound.<init>(Sound.java:83)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:20)
at com.tutorial.main.Game.<init>(Game.java:42)
at com.tutorial.main.Game.main(Game.java:183)
 
Saloon Keeper
Posts: 13294
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a bad module descriptor, or you've added LWJGL to the module path when you intended to put it on the class path.

How are you building and running the application? What Java version are you using? Can you show us your module-info.java file, if you have one in your project?
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LWJGL is not in Modul Path but in the Path class, I use the Java version 16.0.1, I do not create a module
 
Norm Radder
Master Rancher
Posts: 4465
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the full path to the lwjgl64.dll file?
What is the full contents of the OS's PATH environment variable?
 
Stephan van Hulst
Saloon Keeper
Posts: 13294
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It appears to me that you have conflicting dependencies.

I would recommend that instead of installing LWJGL anywhere on your system manually, you use a Maven POM and add references to the required dependencies.
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The file lwjgl64.dll is in the SLICK folder in my documents
Is there a way to copy the complete content of the environment variable ???
More about this source text
Source text required for additional translation information
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in Stephan
Pom Maven still something new to learn, I'm top watching
But it has shown YouTube's video
not sure that the person who wrote this game program uses Pom Maven but I have not finished copying all the code
 
Stephan van Hulst
Saloon Keeper
Posts: 13294
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that the JVM has found multiple classes that are in the org.lwjgl.openal package, but they are not in the same JAR.

Have you installed Slick or LWJGL more than once, or both at the same time? Have you moved files between different locations on your system? Have you written classes that are accidentally in the org.lwjgl.openal package?
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed the two slick and lwjgl more than once
I erased and reinstall several times
I do not have org.lwjgl.openal touches
what makes it up, these are the native libraries
if I understood correctly, it's the .dll files that I put in
and I do not arrive because it does not appear in the window path when you click on External Folder
it may be that that Norm spoke to me
 
Stephan van Hulst
Saloon Keeper
Posts: 13294
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your initial problem was that the application couldn't find the LWJGL binaries from the environment variables. You solved that. The new problem is that you likely have multiple JARs floating around from different installations that contain the org.lwjgl.openal package. I can't tell you how to fix that because I don't know what your runtime classpath looks like. It would have been more easy for me to tell you if your application was using Maven, but it doesn't.
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I just realized that you have to use either slick or lwjgl
What I did, I suppress LWJGL and keep slick
I created a Library native folder and put the .dll files in
Then I went to Java Build Path - Slick - Lwjgl.jar - Native Library Location - External Folder, I added the Native Library file that I created
I give you what the console tells me
an error at the sound level,
Thank you for your help to understand the console

Sun Aug 15 14:47:42 CEST 2021 INFO:Initialising sounds..
Sun Aug 15 14:47:42 CEST 2021 INFO:- Sound works
Sun Aug 15 14:47:42 CEST 2021 INFO:- 64 OpenAL source available
Sun Aug 15 14:47:42 CEST 2021 INFO:- Sounds source generated
Sun Aug 15 14:47:42 CEST 2021 ERROR:Failure reading in vorbis
Sun Aug 15 14:47:42 CEST 2021 ERROR:null
java.lang.IndexOutOfBoundsException
at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:336)
at org.newdawn.slick.openal.OggInputStream.getPageAndPacket(OggInputStream.java:154)
at org.newdawn.slick.openal.OggInputStream.readPCM(OggInputStream.java:294)
at org.newdawn.slick.openal.OggInputStream.read(OggInputStream.java:446)
at org.newdawn.slick.openal.OggDecoder.getData(OggDecoder.java:315)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:835)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:793)
at org.newdawn.slick.Sound.<init>(Sound.java:87)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:20)
at com.tutorial.main.Game.<init>(Game.java:42)
at com.tutorial.main.Game.main(Game.java:183)
Sun Aug 15 14:47:42 CEST 2021 ERROR:/ by zero
java.lang.ArithmeticException: / by zero
at org.newdawn.slick.openal.AudioImpl.<init>(AudioImpl.java:38)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:854)
at org.newdawn.slick.openal.SoundStore.getOgg(SoundStore.java:793)
at org.newdawn.slick.Sound.<init>(Sound.java:87)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:20)
at com.tutorial.main.Game.<init>(Game.java:42)
at com.tutorial.main.Game.main(Game.java:183)
org.newdawn.slick.SlickException: Failed to load sound: res/mouse_click.ogg
at org.newdawn.slick.Sound.<init>(Sound.java:99)
at com.tutorial.main.AudioPlayer.load(AudioPlayer.java:20)
at com.tutorial.main.Game.<init>(Game.java:42)
at com.tutorial.main.Game.main(Game.java:183)
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.newdawn.slick.Music.loop()" because the return value of "com.tutorial.main.AudioPlayer.getMusic(String)" is null
at com.tutorial.main.Game.<init>(Game.java:43)
at com.tutorial.main.Game.main(Game.java:183)
AL lib: (EE) alc_cleanup: 1 device not closed
 
Norm Radder
Master Rancher
Posts: 4465
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.newdawn.slick.Music.loop()" because the return value of "com.tutorial.main.AudioPlayer.getMusic(String)" is null


Why does getMusic() return null?  
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I probably made a mistake somewhere or I forgot a piece of code
 Return is null because he can not read music
I do not really understand
after the console, SOUND (Mouse_Click) is not Read, in the code, it corresponds to slick.sound
but there, it is music (background_music) which is concerned which corresponds to slick.music that returns null
I do not know
 
ronald deux
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again
I just change the music of the mouse
The game works
then know why mouse_click.ogg does not work with the code
Yet there is sound when I use Groove music from Windows 10
thanks to you two
 
reply
    Bookmark Topic Watch Topic
  • New Topic