Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Linux)undefined reference to `Java_com_sun_management_internal_OperatingSystemImpl_initialize0' #507

Closed
yyyyyyyysssss opened this issue Jun 29, 2024 · 1 comment

Comments

@yyyyyyyysssss
Copy link

platform:
wsl2 debian12

gcc version:
gcc version 12.2.0 (Debian 12.2.0-14)

ld version:
GNU ld (GNU Binutils for Debian) 2.4

graalvm version:
java version "21.0.1" 2023-10-17
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19, mixed mode, sharing)

my pom.xml:

<plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <version>${gluonfx.plugin.version}</version>
                <configuration>
                    <mainClass>org.imtp.client.MainApp</mainClass>
                    <attachList>
                        <list>display</list>
                        <list>lifecycle</list>
                        <list>statusbar</list>
                        <list>storage</list>
                    </attachList>
                    <nativeImageArgs>
                        <nativeImageArg>-H:TraceClassInitialization=true</nativeImageArg>
                        <nativeImageArg>--initialize-at-build-time=ch.qos.logback.core.pattern.parser.Parser,ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.util.Loader,org.slf4j.impl.StaticLoggerBinder,org.slf4j.LoggerFactory,ch.qos.logback.classic.Logger,ch.qos.logback.core.spi.AppenderAttachableImpl,ch.qos.logback.core.status.StatusBase,ch.qos.logback.classic.Level,ch.qos.logback.core.status.InfoStatus,ch.qos.logback.classic.PatternLayout,ch.qos.logback.core.CoreConstants</nativeImageArg>
                        <nativeImageArg>--trace-class-initialization=ch.qos.logback.classic.Level,ch.qos.logback.core.util.Loader,ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.CoreConstants,ch.qos.logback.classic.Logger,ch.qos.logback.core.pattern.parser.Parser</nativeImageArg>
                        <nativeImageArg>--initialize-at-run-time=io.netty.channel.AbstractChannel</nativeImageArg>
                    </nativeImageArgs>
                    <reflectionList>
                        <list>org.imtp.client.controller.LoginController</list>
                        <list>org.imtp.client.controller.HomeController</list>
                        <list>org.imtp.client.controller.UserSessionController</list>
                        <list>org.imtp.client.controller.UserSessionItemController</list>
                        <list>org.imtp.client.controller.ChatController</list>
                        <list>org.imtp.client.controller.ChatItemController</list>
                        <list>org.imtp.client.controller.UserFriendController</list>
                        <list>org.imtp.client.controller.UserFriendItemController</list>
                        <list>org.imtp.client.controller.UserFriendDetailsController</list>
                        <list>org.imtp.client.controller.UserGroupController</list>
                        <list>org.imtp.client.controller.UserGroupDetailsController</list>
                        <list>org.imtp.client.controller.UserGroupItemController</list>
                        <list>org.imtp.client.controller.ChatEmojiDialog</list>
                    </reflectionList>
                    <!-- <bundlesList>
                        <list>com.sun.glass.ui.win</list>
                    </bundlesList> -->
                    <linkerArgs>
                        <arg>management_ext.lib</arg>
                        <arg>psapi.lib</arg>
                    </linkerArgs>
                </configuration>
            </plugin>

native build Linking failed:

Process
=======
link

Command Line
============
gcc /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/gvm/client/launcher.o /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/gvm/tmp/SVM-1719641510646/org.imtp.client.mainapp.o /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjava.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnio.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libzip.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libnet.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libprefs.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libj2pkcs11.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libextnet.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libfontmanager.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libjavajpeg.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/liblcms.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libawt_headless.a /opt/graalvm-jdk-21.0.1+12.1/lib/static/linux-amd64/glibc/libawt.a -l:libjvm.a -l:liblibchelper.a -lz -ldl -lstdc++ -lpthread -Wl,--wrap=pow -rdynamic -lprism_es2 -lglass -lglassgtk3 -ljavafx_font -ljavafx_font_freetype -ljavafx_font_pango -ljavafx_iio -lgstreamer-lite -lavcodec -lavformat -lavutil -lasound -Wl,--no-whole-archive -lGL -lX11 -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lfreetype -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lgthread-2.0 -pthread -lglib-2.0 -lstdc++ -lz -lXtst -lm -lgmodule-2.0 -pthread -lglib-2.0 -lm -ldl -o /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/client -L/opt/graalvm-jdk-21.0.1+12.1/lib/svm/clibraries/linux-amd64 -L/root/.gluon/substrate/javafxStaticSdk/21-ea+11.1/linux-x86_64/sdk/lib

Output
======
/usr/bin/ld: warning: /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/gvm/tmp/SVM-1719641510646/org.imtp.client.mainapp.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/gvm/tmp/SVM-1719641510646/org.imtp.client.mainapp.o: warning: relocation in read-only section `.svm_heap'
/usr/bin/ld: /root/dev/java-project/imtp/client/target/gluonfx/x86_64-linux/gvm/tmp/SVM-1719641510646/org.imtp.client.mainapp.o:(.data+0xfe8): undefined reference to `Java_com_sun_management_internal_OperatingSystemImpl_initialize0'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status


Result
======
result: 1
@yyyyyyyysssss yyyyyyyysssss changed the title undefined reference to `Java_com_sun_management_internal_OperatingSystemImpl_initialize0' (Linux)undefined reference to `Java_com_sun_management_internal_OperatingSystemImpl_initialize0' Jun 29, 2024
@yyyyyyyysssss
Copy link
Author

#477 (comment) We solved it with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant