Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug the openjdk9 by netbeans8.2 in win10?

When I tried to debug the openjdk9 by netbeans8.2 in win10, I got the following error:

"\"D:/jdk9/jdk9/build/windows-x86_64-normal-server-fastdebug/jdk/bin/java.exe\": 
not in executable format: File format not recognized"

How can I fix it?

I build the source code by command "./configure -with-freetype=/cygdrive/c/freetype -enable-debug -with-target-bits=64", then run make all, I also tried slowdebug, however, that also failed.

enter image description here

If I "run" the project instead of "debug", it runs successfully like below, so there is no issue for the file windows-x86_64-normal-server-fastdebug/jdk/bin/java.exe, it seems the gdb doesn't recognize the java.exe file. enter image description here

Also I opened the openjdk source code from the location D:/jdk9/jdk/common/nb_native by netbeans, see below: enter image description here

And tried to build it by netbeans, however, it produces the following error:

cd 'D:\jdk9\jdk\common'
sh ../configure --with-freetype=/cygdrive/c/freetype --with-debug-level=slowdebug --with-target-bits=64
/cygdrive/d/jdk9/jdk/configure: /cygdrive/d/jdk9/jdk/common/autoconf/configure: No such file or directory
PRE-BUILD FAILED (exit value 1, total time: 743ms)

I know that both paths /cygdrive/d/jdk9/jdk/configure and /cygdrive/d/jdk9/jdk/common/autoconf/configure exist.

This is how I configured the pre-built commands: enter image description here

like image 711
YuFeng Shen Avatar asked Oct 06 '18 14:10

YuFeng Shen


1 Answers

  1. If you build the openjdk -with-target-bits = 64, then make sure that you installed a 64-bit gdb, or build the openjdk in 32-bit mode.

  2. Your steps to import the nbproject looks correct.

  3. Change Build => Pre-Build properties:

    Set "Working Directory" to ../..

    Set "Command Line" to sh ./configure ...

like image 148
Oleksandr Pyrohov Avatar answered Nov 09 '22 18:11

Oleksandr Pyrohov