LWJGL由于某些Apple库(Objective-c)行为不正常而无法在Mac上运行?

问题描述 投票:0回答:1

我正在尝试使LWJGL在我的计算机上工作(安装了Sierra的旧Mac,但是有些断言失败了,并且是Objective-C?

我正在使用IntelliJ和Maven并遵循Wiki(https://github.com/LWJGL/lwjgl3-wiki/wiki/1.2.-Install)。我正在使用Java 11,并且本机jar的作用域设置为运行时。

pom.xml在下面。我是从https://www.lwjgl.org/customize中获得的,我只是选择了所有内容(所有库和插件)并生成了它。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.me.lwjgltest</groupId>
    <artifactId>LWJGLTest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile><id>lwjgl-natives-linux</id><activation><os><family>unix</family></os></activation><properties><lwjgl.natives>natives-linux</lwjgl.natives> <!-- Add -arm64 or -arm32 to get the ARM builds --><lwjgl.natives.vulkan></lwjgl.natives.vulkan></properties></profile>
        <profile><id>lwjgl-natives-macos</id><activation><os><family>mac</family></os></activation><properties><lwjgl.natives>natives-macos</lwjgl.natives><lwjgl.natives.vulkan>natives-macos</lwjgl.natives.vulkan></properties></profile>
        <profile><id>lwjgl-natives-windows</id><activation><os><family>windows</family></os></activation><properties><lwjgl.natives>natives-windows</lwjgl.natives><lwjgl.natives.vulkan></lwjgl.natives.vulkan></properties></profile>
    </profiles>

    <dependencies>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-bgfx</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-cuda</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-egl</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jawt</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jemalloc</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-libdivide</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-llvm</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lmdb</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lz4</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-meow</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nanovg</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nfd</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nuklear</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-odbc</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opencl</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengles</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openvr</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opus</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-ovr</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-par</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-remotery</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-rpmalloc</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-sse</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyexr</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyfd</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tootle</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-vma</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-vulkan</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-xxhash</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-yoga</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-zstd</artifactId><version>3.2.2</version></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-bgfx</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jemalloc</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-libdivide</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-llvm</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lmdb</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lz4</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-meow</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nanovg</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nfd</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nuklear</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengles</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openvr</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opus</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-ovr</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-par</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-remotery</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-rpmalloc</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-sse</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyexr</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyfd</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tootle</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-vma</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-vulkan</artifactId><version>3.2.2</version><classifier>${lwjgl.natives.vulkan}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-xxhash</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-yoga</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-zstd</artifactId><version>3.2.2</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency>
        <dependency><groupId>org.joml</groupId><artifactId>joml</artifactId><version>1.9.15</version></dependency>
        <dependency><groupId>com.code-disaster.steamworks4j</groupId><artifactId>steamworks4j</artifactId><version>1.8.0</version></dependency>
        <dependency><groupId>com.code-disaster.steamworks4j</groupId><artifactId>steamworks4j-server</artifactId><version>1.8.0</version></dependency>
    </dependencies>


</project>

由于我只是设置LWJGL,所以我只是想在https://www.lwjgl.org/guide处运行示例代码。

但是,当我运行示例代码时,我得到了:

Hello LWJGL 3.2.2 build 10!
2019-06-08 20:03:28.554 java[80012:1268785] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1349.91/Misc.subproj/NSUndoManager.m:363
2019-06-08 20:03:28.555 java[80012:1268785] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fffc393c57b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fffd8bb31da objc_exception_throw + 48
    2   CoreFoundation                      0x00007fffc3941132 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x00007fffc53a8be0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   Foundation                          0x00007fffc5333093 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 170
    5   AppKit                              0x00007fffc139e4ed -[NSApplication run] + 1200
    6   libglfw.dylib                       0x0000000126a109d5 libglfw.dylib + 68053
    7   libglfw.dylib                       0x0000000126a0a366 libglfw.dylib + 41830
    8   ???                                 0x00000001166a88d0 0x0 + 4671047888
)
libc++abi.dylib: terminating with uncaught exception of type NSException

我希望我可以删除一些库/附加组件,并且此问题将得到解决。我唯一想到的另一件事就是更新操作系统,但我现在还不想这样做。

编辑:我已经尝试在自定义站点上使用“最小OpenGL”,但是会发生相同的情况。EDIT2:尝试了“入门”。没运气。意识到错误是Objective-C ...

java objective-c macos maven lwjgl
1个回答
0
投票

applicationDefaultJvmArgs = ["-XstartOnFirstThread"]

将其添加到构建包中。不确定为什么苹果库也位于我的堆栈跟踪中

© www.soinside.com 2019 - 2024. All rights reserved.