Discord Bot Java (Maven) 找不到库,加载失败 (com.sedmelluq / lavaplayer)

Discord Bot Java (Maven) Library not found, loading failed (com.sedmelluq / lavaplayer)

我用 Java (Eclipse) 编写了一个 Discord 机器人程序。如果我在 Eclipse 中通过控制台启动它,它可以正常工作。如果我将它导出为“可运行的 JAR 文件”并使用 start.bat 文件启动它,它也可以正常工作。

start.bat:

java -jar NameOfTheFile.jar
pause

但是,我不想让我的电脑一直开着。一个朋友不会有这个问题,所以这个机器人在他的电脑上运行。 如果 bot 由 start.bat 文件启动,则不会出现错误消息并且可以正常工作。但是,如果要播放音乐(由 !play 在语音通道中通过机器人触发),则会出现找不到库(播放音乐所需)的错误...

错误(短版):

[lava-daemon-pool-playback-1-thread-1] INFO com.sedmelluq.lava.common.natives.NativeLibraryLoader - Native library libmpg123-0: loading with filter com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader$$Lambda5/29224482@159940e
[lava-daemon-pool-playback-1-thread-1] ERROR com.sedmelluq.lava.common.natives.NativeLibraryLoader - Native library {}: loading failed.
java.lang.UnsatisfiedLinkError: Required library was not found
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.extractLibraryFromResources(NativeLibraryLoader.java:128)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadInternal(NativeLibraryLoader.java:113)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadAndRemember(NativeLibraryLoader.java:85)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.load(NativeLibraryLoader.java:70)
        at com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader.loadConnectorLibrary(ConnectorNativeLibLoader.java:21)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.getInstance(OpusDecoderLibrary.java:14)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoder.<init>(OpusDecoder.java:20)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.initialiseDecoder(OpusPacketRouter.java:194)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.checkDecoderNecessity(OpusPacketRouter.java:178)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.process(OpusPacketRouter.java:94)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaOpusTrackConsumer.consume(MatroskaOpusTrackConsumer.java:47)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.processFrameInBlock(MatroskaStreamingFile.java:372)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseClusterSimpleBlock(MatroskaStreamingFile.java:336)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseNextCluster(MatroskaStreamingFile.java:321)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.provideFrames(MatroskaStreamingFile.java:297)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.lambda$process[=13=](MatroskaAudioTrack.java:40)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:276)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:250)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:39)
        at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:57)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:49)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:105)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack(DefaultAudioPlayerManager.java:349)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[lava-daemon-pool-playback-1-thread-1] INFO com.sedmelluq.lava.common.natives.NativeLibraryLoader - Native library connector: loading with filter null
[lava-daemon-pool-playback-1-thread-1] ERROR com.sedmelluq.lava.common.natives.NativeLibraryLoader - Native library {}: loading failed.
java.lang.UnsatisfiedLinkError: Required library was not found
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.extractLibraryFromResources(NativeLibraryLoader.java:128)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadInternal(NativeLibraryLoader.java:113)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.loadAndRemember(NativeLibraryLoader.java:85)
        at com.sedmelluq.lava.common.natives.NativeLibraryLoader.load(NativeLibraryLoader.java:70)
        at com.sedmelluq.discord.lavaplayer.natives.ConnectorNativeLibLoader.loadConnectorLibrary(ConnectorNativeLibLoader.java:21)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.getInstance(OpusDecoderLibrary.java:14)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoder.<init>(OpusDecoder.java:20)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.initialiseDecoder(OpusPacketRouter.java:194)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.checkDecoderNecessity(OpusPacketRouter.java:178)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.process(OpusPacketRouter.java:94)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaOpusTrackConsumer.consume(MatroskaOpusTrackConsumer.java:47)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.processFrameInBlock(MatroskaStreamingFile.java:372)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseClusterSimpleBlock(MatroskaStreamingFile.java:336)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseNextCluster(MatroskaStreamingFile.java:321)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.provideFrames(MatroskaStreamingFile.java:297)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.lambda$process[=13=](MatroskaAudioTrack.java:40)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:276)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:250)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:39)
        at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:57)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:49)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:105)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack(DefaultAudioPlayerManager.java:349)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[lava-daemon-pool-playback-1-thread-1] ERROR com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor - Error in playback of Kh2FRFhS7QY
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track.
        at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:43)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:117)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack(DefaultAudioPlayerManager.java:349)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.create(II)J
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.create(Native Method)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoder.<init>(OpusDecoder.java:21)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.initialiseDecoder(OpusPacketRouter.java:194)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.checkDecoderNecessity(OpusPacketRouter.java:178)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.process(OpusPacketRouter.java:94)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaOpusTrackConsumer.consume(MatroskaOpusTrackConsumer.java:47)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.processFrameInBlock(MatroskaStreamingFile.java:372)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseClusterSimpleBlock(MatroskaStreamingFile.java:336)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseNextCluster(MatroskaStreamingFile.java:321)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.provideFrames(MatroskaStreamingFile.java:297)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.lambda$process[=13=](MatroskaAudioTrack.java:40)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:276)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:250)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:39)
        at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:57)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:49)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:105)
        ... 4 more
Exception in thread "lava-daemon-pool-playback-1-thread-1" java.lang.UnsatisfiedLinkError: com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.create(II)J
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoderLibrary.create(Native Method)
        at com.sedmelluq.discord.lavaplayer.natives.opus.OpusDecoder.<init>(OpusDecoder.java:21)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.initialiseDecoder(OpusPacketRouter.java:194)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.checkDecoderNecessity(OpusPacketRouter.java:178)
        at com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter.process(OpusPacketRouter.java:94)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaOpusTrackConsumer.consume(MatroskaOpusTrackConsumer.java:47)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.processFrameInBlock(MatroskaStreamingFile.java:372)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseClusterSimpleBlock(MatroskaStreamingFile.java:336)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseNextCluster(MatroskaStreamingFile.java:321)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.provideFrames(MatroskaStreamingFile.java:297)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.lambda$process[=13=](MatroskaAudioTrack.java:40)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:276)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:250)
        at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:39)
        at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:57)
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:49)
        at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:105)
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack(DefaultAudioPlayerManager.java:349)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

如有必要,我可以附上 pom.xml。 com.sedmelluq 或 lavaplayer 由以下依赖添加:

<dependency>
  <groupId>com.sedmelluq</groupId>
  <artifactId>lavaplayer</artifactId>
  <version>1.3.50</version>
</dependency>

为什么我的一切都适用,而另一台 PC 却不行?有人可以帮忙吗?谢谢:)

问题是我朋友的电脑是 32 位系统,音乐库可能只能在 64 位系统上运行。