У меня возникла ошибка при запуске программы, я также использую библиотеки 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
Java UnsatisfiedLinkError libgdk ⇐ JAVA
Программисты JAVA общаются здесь
1737464923
Anonymous
У меня возникла ошибка при запуске программы, я также использую библиотеки gdx-1.12.0 и spine-libgdx-4.1.1
[b]Дерево файлов[/b]
.
├── 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
[b]build.sh[/b]
#/bin/bash
javac -d . -cp "./lib/*:." src/SkeletonConverter.java
[b]run.sh[/b]
#/bin/bash
java -Djava.library.path=./native \
-cp "./lib/*:." \
SkeletonConverter \
./data/Naia.skel.bytes \
./data/output.json \
./data/Naia.atlas \
[b]SkeletonConverter.java[/b]
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();
}
}
}
}
[b]run.sh[/b] ошибка:
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)
Подробнее здесь: [url]https://stackoverflow.com/questions/79374532/java-unsatisfiedlinkerror-libgdk[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия