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

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.
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.
Also I opened the openjdk source code from the location D:/jdk9/jdk/common/nb_native by netbeans, see below:
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:

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.
Your steps to import the nbproject looks correct.
Change Build => Pre-Build properties:
Set "Working Directory" to ../..
Set "Command Line" to sh ./configure ...

Related

How to compile ClickHouse in CLion?

I'm trying to build ClickHouse in CLion.
I follow the official documentation. I was able to build ClickHouse from the command line, however, I would also like to be able to build it in CLion.
The documentation doesn't give out much information on how to do that, only implies that it's possible. ClickHouse's GitHub Issues search by 'CLion' also do not offer much advice.
ClickHouse uses CMake and Ninja. The documentation mentions that one can use either Ninja or make instead of Ninja to compile in CLion.
I tried both and got many errors. For example, when running with CMake settings set to -G Ninja, I was able to build the target common but I get the following error when building the target clickhouse-client:
====================[ Build | clickhouse-client | Debug ]=======================
/usr/bin/cmake --build /tmp/tmp.CAA3nJhi8z/cmake-build-debug --target clickhouse-client
[1/7338] Generating lber-version.c
FAILED: contrib/openldap-cmake/lber-version.c
cd /tmp/tmp.CAA3nJhi8z/contrib/openldap && /usr/bin/cmake -E env bash -c "/tmp/tmp.CAA3nJhi8z/contrib/openldap/build/mkversion -v '2.5.X' liblber.la > \"/tmp/tmp.CAA3nJhi8z/cmake-build-debug/contrib/openldap-cmake/lber-version.c\""
bash: /tmp/tmp.CAA3nJhi8z/contrib/openldap/build/mkversion: Permission denied
[18/7338] Building CXX object contrib/..._/icu/icu4c/source/i18n/calendar.cpp.o
ninja: build stopped: subcommand failed.
I also use a remote toolchain in CLion to build on a server, not my laptop. Since it's a permission issue, I assume I have to run the build from sudo but I'm not sure how to do that, and searching only offers a guide on How to debug as root in CLion.
Question #2. Is it OK that after CMake loaded in CLion, I don't see any green arrows in the CMakeLists.txt in the root of the ClickHouse project? I can only see targets in the top right corner dropdown (screenshot).
Question #3. I'm also unsure how to build all the binaries in CLion. E.g. in the command line, I would just run ninja but in CLion there are so many targets, and none of them is named like build all.
Any pointers to a solution are much appreciated.
It might be helpful to someone to answer your first question.
Since you are using a remote build, the Clion first copies all source files to the remote machine. And if the option
Settings -> Build,Execution,Deployment -> Deployment -> Options -> Preserve original file permissions
is not enabled, it does not save the executable permissions to run some scripts. Which breaks the build.
Therefore, you can either enable this option and re-upload the files or set permission x manually to the files that will be logged in the error message.

Chromium single executable build

I've been following the documentation here to build Chromium on Ubuntu 18.
I've been able to successfully build using these flags gn gen out/amd64 --args='is_official_build=true is_debug=false'
and this command to build
autoninja -C out/amd64 chrome
The problem is that the outputting chrome file has dependencies on all the other files in the directory. When I copy the chrome file to another directory and execute it, I get this error
[0608/170138.585281:ERROR:icu_util.cc(165)] Invalid file descriptor to ICU data received.
Trace/breakpoint trap (core dumped)
How do I go about building Chromium so I can execute it from a single file like how Puppeteer is a single executable?

How to set up and build Apache 2.4 on WINDOWS 7 Pro?

I have a project, and need to set up and build an Apache24 server on windows, but there is almost non of information on that, can you give some advice?
I had to build and install Expat to get Apache running on windows 10 x64 with the instructions above. I build on Windows Visual Studio 2017 Community Edition using the x64 Native Command Prompt. (I installed all the VC and C++ modules - not sure which ones were specifically required.) Also i used the latest version of all of the software listed above so the install commands had to be adjusted accordingly. Trial by fire! Good luck.
I found the answer, after a lot of searching, I found an acceptable way to do it.
Software Requirements:
Visual Studio 2013 (I use the Community Edition)
Make a folder on C, call it BuildTools and install all the following programs there:
ActivePerl for Windows (64-bit, currently using 5.20.1.2000)
CMake for Windows (currently using 3.1.3)
GNU Awk for Windows (currently using 3.1.6-1)
GnuWin32 (any version from 2014+)
Netwide Assembler (NASM) (currently using 2.11.06)
Source Code Packages (I don't use ZLIB for Apache or OpenSSL, or LUA/LIBXML2/EXPAT, therefore these are not included in the process):
httpd-2.4.12.tar.gz
apr-1.5.1.tar.gz
apr-util.1.5.4.tar.gz
openssl-1.0.2a.tar.gz (yes it works with 1.0.2a!)
pcre-8.36.tar.gz
Here are the steps:
Extract all packages into their separate folders in your preferred source tree (e.g. C:\Development\Apache24\src)
Create custom build folders for Apache, PCRE, APR and APR-Util in your preferred build folder (e.g. C:\Development\Apache24\build
Your folder structure should resemble the below:
Make the following file changes so that ApacheMonitor gets built (without the Manifest error):
C:\Development\Apache24\src\httpd-2.4.12\CMakeLists.txt
Uncomment the section to build the ApacheMonitor utility (lines 769-775)
Find the following lines below, they will be in comments
# getting duplicate manifest error with ApacheMonitor
ADD_EXECUTABLE(ApacheMonitor support/win32/ApacheMonitor.c support/win32/ApacheMonitor.rc)
SET(install_targets ${install_targets} ApacheMonitor)
SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/ApacheMonitor.pdb)
SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES WIN32_EXECUTABLE TRUE)
SET_TARGET_PROPERTIES(ApacheMonitor PROPERTIES COMPILE_FLAGS "-DAPP_FILE -DLONG_NAME=ApacheMonitor -DBIN_NAME=ApacheMonitor.exe / ${EXTRA_COMPILE_FLAGS}")
TARGET_LINK_LIBRARIES(ApacheMonitor ${EXTRA_LIBS} ${HTTPD_SYSTEM_LIBS} comctl32 wtsapi32)
Also
C:\Development\Apache24\src\httpd-2.4.12\support\win32\ApacheMonitor.rc
Comment out the line that includes ApacheMonitor.manifest (line 29)
//CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ApacheMonitor.manifest"
4.1 Create a set_path.bat file with the following code:
SET VC_HOME=c:\Program Files (x86)\Microsoft Visual Studio 13.0\VC
call VC_HOME\vcvarsall amd64
SET BUILD_ROOT=C:\BuildTools
SET PATH=%PATH%;%BUILD_ROOT%\cmake\bin
SET PATH=%PATH%;%BUILD_ROOT%\gawk\bin
SET PATH=%PATH%;%BUILD_ROOT%\nasm
SET PATH=%PATH%;%BUILD_ROOT%\perl\bin
You will need to run that file later in the process.
From the Start menu, launch the VS2013 x64 Native Tools Command Prompt found under Visual Studio 2013->Visual Studio Tools. Alternatively, but not recommended, from a Windows Command Prompt.
5.1 Go to GnuWin32, find his lib and the include folder, and copy their content to the BuildTools/perl/lib folder, this should resolve some errors that came up in the process while I was doing this
5.2 This step, you can skip now, BUT, if there is an error that includes the expat.h and the expath_external.h files, Find an older version of Apache, and copy its expat_external.h to the apache24/include folder
Find expat.h file on this site
https://github.com/apache/apr-util/blob/0.9.x/xml/expat/lib/expat.h
copy its content over the file, you find in apache24/include folder Find an older version of Apache (don't know exactly witch version), and copy its expat_external.h to the apache24/include folder
Find expat.h file on this site
https://github.com/apache/apr-util/blob/0.9.x/xml/expat/lib/expat.h
copy its content over the file, you find in apache24/include folder
5.3. Find the set_path.bat folder from the console and run it.
this you need to do, to be able to run the next steps
Navigate into the build sub-folder for PCRE, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\pcre
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DPCRE_BUILD_TESTS=OFF -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_SUPPORT_PCREGREP_JIT=OFF -DPCRE_SUPPORT_UTF=ON -DPCRE_SUPPORT_UNICODE_PROPERTIES=ON -DPCRE_NEWLINE=CRLF -DINSTALL_MSVC_PDB=OFF ..\..\src\pcre-8.36
nmake
nmake install
Navigate into the source sub-folder for OpenSSL, configure the build environment for compiling with NASM, then compile and install
cd /D C:\Development\Apache24\src\openssl-1.0.2a
perl Configure VC-WIN64A --prefix=C:\Apache24 --openssldir=C:\Apache24\conf enable-camellia no-idea no-mdc2 no-ssl2 no-ssl3 no-zlib
ms\do_win64a.bat
nmake /f ms\ntdll.mak
nmake /f ms\ntdll.mak install
Navigate into the build sub-folder for APR, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\apr
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMIN_WINDOWS_VER=0x0600 -DAPR_HAVE_IPV6=ON -DAPR_INSTALL_PRIVATE_H=ON -DAPR_BUILD_TESTAPR=OFF -DINSTALL_PDB=OFF ..\..\src\apr-1.5.1
nmake
nmake install
Navigate into the build sub-folder for APR-Util, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\apr-util
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DOPENSSL_ROOT_DIR=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DAPU_HAVE_CRYPTO=ON -DAPR_BUILD_TESTAPR=OFF -DINSTALL_PDB=OFF ..\..\src\apr-util-1.5.4
nmake
nmake install
Navigate into the build sub-folder for Apache, run CMAKE to generate a suitable Makefile, then compile and install
cd /D C:\Development\Apache24\build\httpd
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\Apache24 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_MODULES=i -DINSTALL_PDB=OFF ..\..\src\httpd-2.4.12
nmake
nmake install
Finally, confirm everything is working
cd /D C:\Apache24\bin
openssl version
httpd -V
These are the steps and the problems I encountered, and I followed the steps from this site:
https://www.apachelounge.com/viewtopic.php?t=6462
Also I added a few more steps and solutions that I needed to do to make it work.
I hope this will help someone else in the future.

Error when try to compile Chromium

I try to use the command ninja -C out/Debug chrome to compile Chromium.
However the error msg says that:
ninja error loading 'build.ninja': the system cannot find the file specified
ninja Entering dictory 'out/Debug'
Could I know what's the problem?
Thanks.
The out directory and its contents (including build.ninja) are created by running
python build\gyp_chromium
or
gclient runhooks
Executing either command from within /src should allow your compile to proceed.
On Windows machine!
When I was running gn gen out/Default it also gave me an error:
ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
^----------
Current dir: D:/Chromium/src/out/Goma/
Command: C:/Python27/python.exe -- D:/Chromium/src/build/vs_toolchain.py get_toolchain_dir
Returned 1 and printed out:
Please follow the instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
I did the following steps and it worked for me.
Set this variable. Reference (not sure about its purpose yet)
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
Run the command gn gen out/Default
Run the build command again
autoninja -C out/Default chrome
It is also recommended to run gclient sync from out/Default directory.
After the switch to "gn" you could try:
gn gen out/Debug

sencha build giving error stbuild exited with non-zero code : 7

I wanted to create .apk file of my sencha application so I executed below command
sencha package build packager.json
but when I executed above command,it generates error as given below.
'C:\Program' is not recognized as an internal or external command,operable program or batch file.
""D:/Android/AndroidSDKr15\tools\android" create project --target android-16 --name chartDemoApp --activity STActivity --path "../build/" --package triumphsys. mobility.chartDemoApp"
Could not run ant with error: 1
Failed to package application
[ERR] stbuild exited with non-zero code : 7
even I have attached my command prompt here and packager.json here.
please help me to resolve it.
I was able to solve the problem by uninstalling "C:\Program files\Sencha Cmd" and again re-installing it at "C:\Sencha" without any spaces in folder name. and it worked for me.