Java UnsatisfiedLinkError libgdkJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Java UnsatisfiedLinkError libgdk

Сообщение Anonymous »

У меня возникла ошибка при запуске программы, я также использую библиотеки gdx-1.12.0 и spine-libgdx-4.1.1
Дерево файлов
.
├── build_command.txt
├── build.sh
├── data
│   ├── Naia.atlas
│   ├── Naia.png
│   └── Naia.skel.bytes
├── lib
│   ├── gdx-1.12.0.jar
│   ├── gdx-backend-lwjgl-1.12.0.jar
│   └── spine-libgdx-4.1.1-20240409.095213-88.jar
├── native
│   ├── gdx-platform-1.12.0-natives-desktop.jar
│   ├── liblwjgl64.so
│   ├── liblwjgl.so
│   ├── libopenal64.so
│   ├── libopenal.so
│   └── lwjgl-platform-2.9.3-natives-linux.jar
├── run.sh
├── script.sh
├── SkelBytesToJsonConverter.java
├── SkeletonConverter.class
├── src
│   ├── backup.java
│   └── SkeletonConverter.java

build.sh
#/bin/bash

javac -d . -cp "./lib/*:." src/SkeletonConverter.java

run.sh
#/bin/bash

java -Djava.library.path=./native \
-cp "./lib/*:." \
SkeletonConverter \
./data/Naia.skel.bytes \
./data/output.json \
./data/Naia.atlas

SkeletonConverter.java
import com.esotericsoftware.spine.SkeletonBinary;
import com.esotericsoftware.spine.SkeletonData;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.utils.Json;
import com.badlogic.gdx.utils.JsonWriter;
import java.io.File;

public class SkeletonConverter {
public static void main(String[] args) {
if (args.length != 3) {
System.out.println("Usage: java SkeletonConverter ");
System.exit(1);
}

TextureAtlas atlas = null;
try {
String inputFile = args[0];
String outputFile = args[1];
String atlasFile = args[2];

File input = new File(inputFile);
File atlasInput = new File(atlasFile);
if (!input.exists()) {
System.err.println("Input file not found: " + inputFile);
System.exit(1);
}
if (!atlasInput.exists()) {
System.err.println("Atlas file not found: " + atlasFile);
System.exit(1);
}

FileHandle skelFile = new FileHandle(input);
FileHandle jsonFile = new FileHandle(new File(outputFile));

atlas = new TextureAtlas(new FileHandle(atlasInput));

SkeletonBinary binary = new SkeletonBinary(atlas);
binary.setScale(1.0f);

SkeletonData skeletonData = binary.readSkeletonData(skelFile);

Json json = new Json();
json.setOutputType(JsonWriter.OutputType.json);
String jsonString = json.prettyPrint(skeletonData);
jsonFile.writeString(jsonString, false);

System.out.println("Successfully converted " + inputFile + " to " + outputFile);

} catch (UnsatisfiedLinkError e) {
System.err.println("UnsatisfiedLinkError: " + e.getMessage());
e.printStackTrace();
System.exit(1);
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
if (e.getCause() != null) {
System.err.println("Caused by: " + e.getCause().getMessage());
}
e.printStackTrace();
System.exit(1);
} finally {
if (atlas != null) {
atlas.dispose();
}
}
}
}

run.sh ошибка:
UnsatisfiedLinkError: 'java.nio.ByteBuffer com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.load(long[], byte[], int, int)'
java.lang.UnsatisfiedLinkError: 'java.nio.ByteBuffer com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.load(long[], byte[], int, int)'
at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.load(Native Method)
at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.(Gdx2DPixmap.java:84)
at com.badlogic.gdx.graphics.Pixmap.(Pixmap.java:188)
at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:101)
at com.badlogic.gdx.graphics.Texture.(Texture.java:122)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.load(TextureAtlas.java:86)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:79)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:75)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:70)
at com.badlogic.gdx.graphics.g2d.TextureAtlas.(TextureAtlas.java:60)
at SkeletonConverter.main(SkeletonConverter.java:38)


Подробнее здесь: https://stackoverflow.com/questions/793 ... ror-libgdk
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»