I decided to install Java on my FreeBSD box today. It wasn’t a very good experience. Primary the system is not automated. It requires a lot of manual works.
Anyway, after waiting for couple hours, I found that the process was stuck on glib. The system could not build the /usr/ports/devel/glib20. Here is the error message:
===> Building for glib-2.34.3 gmake all-recursive gmake[1]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3' Making all in . gmake[2]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3' gmake[2]: Nothing to be done for `all-am'. gmake[2]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3' Making all in m4macros gmake[2]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/m4macros' gmake[2]: Nothing to be done for `all'. gmake[2]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/m4macros' Making all in glib gmake[2]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' gmake all-recursive gmake[3]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' Making all in libcharset gmake[4]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib/libcharset' gmake[4]: Nothing to be done for `all'. gmake[4]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib/libcharset' Making all in update-pcre gmake[4]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib/update-pcre' gmake[4]: Nothing to be done for `all'. gmake[4]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib/update-pcre' Making all in . gmake[4]: Entering directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' CC gstrfuncs.lo CC gthreadpool.lo gstrfuncs.c:330: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'get_C_locale' gstrfuncs.c: In function 'g_ascii_strtod': gstrfuncs.c:700: warning: implicit declaration of function 'strtod_l' gstrfuncs.c:700: warning: implicit declaration of function 'get_C_locale' gstrfuncs.c: In function 'g_ascii_formatd': gstrfuncs.c:902: error: 'locale_t' undeclared (first use in this function) gstrfuncs.c:902: error: (Each undeclared identifier is reported only once gstrfuncs.c:902: error: for each function it appears in.) gstrfuncs.c:902: error: expected ';' before 'old_locale' gstrfuncs.c:904: error: 'old_locale' undeclared (first use in this function) gstrfuncs.c:904: warning: implicit declaration of function 'uselocale' gstrfuncs.c: In function 'g_ascii_strtoull': gstrfuncs.c:1148: warning: implicit declaration of function 'strtoull_l' gstrfuncs.c: In function 'g_ascii_strtoll': gstrfuncs.c:1195: warning: implicit declaration of function 'strtoll_l' gmake[4]: *** [gstrfuncs.lo] Error 1 gmake[4]: *** Waiting for unfinished jobs.... gmake[4]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3/glib' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/usr/ports/devel/glib20/work/glib-2.34.3' gmake: *** [all] Error 2 *** Error code 1 Stop in /usr/ports/devel/glib20. *** Error code 1 Stop in /usr/ports/devel/glib20.
This is not a popular problem. After I google a while, I found a very similar problem here. Basically, the author suggests that the problem may be caused by an uncleaned run of freebsd-update. In short, you need to run the program twice, i.e.,
sudo freebsd-update fetch install sudo reboot sudo freebsd-update install
Obviously, it didn’t work for me. So I decided to try my last solution: pkg_add
sudo pkg_add -r glib20
and I tried to resume the installation:
cd /usr/ports/java/jdk16 sudo make install
It worked!
Hope this little trick is helpful to you.
–Derrick
Our sponsors: