Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Anyway, a search of the blfs-support mailing-list archives has brought up this error before, although nothing has come about from it and as far as I know they are still looking into it. So does anyone have any suggestions of fixing it? My only other option could be to follow the hint, as that appears to be have been extensively tested, and the BLFS book is still cvs.
I had similar problems when I followed the blfs book. Although it was an assertion in a different location. I decided to follow the hint from tushar instead and managed to compile java successfully. But still not able to use the plugin in mozilla yet. It gets to where it completely loaded the java applet but once it tries to run it then it crashes.
The hint just recently changed to 1.4.1 so I'm working on compiling that now and I just recompiled mozilla-1.0.2 to see if that makes any difference. I'm trying all of them without optimizations first. If I get it working properly then I'll try optimizations later.
Something you might want to do if you aren't already is to make a script which unpacks a clean source tree applies the patches and runs all the commands for a build. Makes it easier to reproduce the same build with only a slight adjustment. Java tends to be very picky if you have something set slightly wrong.
Mik - can you help with the java hint? It says to donwload the patches from the primary site of the hint, ftp://ftp.linuxfromscratch.org yeah? Which patches does it mean as I can't find anything? There is the j2sdk-gcc31.patch for the BLFS book on compiling java, but I'm not sure whether to use that or not?
The primary location of the hint is at http://linuxfromscratch.org/~tushar/hints
There is a link to the patches there also, you don't necessarily need all of them but my 1.4.1 build I did last night failed. It was trying to link against a local copy of motif although I want it to be using lesstif. Still gotta figure that out.
And the make clobber is supposed to start you out with a clean source tree not delete the sources. So it must have been a slight error. I include unpacking the sources in my build script so I never use make clobber.
Just in case you run into the same problem. The modified hint seems to be missing the part where it notifies you to set ALT_MOTIF_DIR. If it's not set then the copy of motif which is included with java doesn't get built. The hint does say it needs to link against the included version otherwise it will crash.
Well this is the line I added in my build script:
Mik do you want to post a copy of your script up - I'm having trouble getting the hint to work with errors in different places and loads of things I keep forgetting. I'm not too brilliant with bash to start from scratch.
Well I still haven't successfully manage to compile a 1.4.1 when I don't set the ALT_MOTIF_DIR it doesn't compile motif and if I set it like it explains in the SUN build guide. It should be $SRC/motif then it fails finding header files and also gives an error when trying to rm the Xm directory which seems kinda weird to want to do that. Well I don't have a lot of time to work on this, I still have a successfull compile of 1.4.0 but it crashes when I use the plugin in mozilla.
Anyways here is the script I use:
Code:
# used the following patches
#
#j2sdk-1.4.1-fix-intl-files.patch.bz2
#j2sdk-1.4.1-link-missing-libs.patch.bz2
#j2sdk-1.4.1-remove-fixed-paths.patch.bz2
#j2sdk-1.4.1-syntax-fixes.patch.bz2
#j2sdk-1.4.1-use-included-motif.patch.bz2
# first install java binary version in binary directory
export JAVA_HOME=$PWD/binary/j2sdk1.4.0_03 &&
mkdir -p src &&
cd src &&
for i in ../j2sdk-1_4_1-*.zip ; do unzip $i; done &&
for i in ../*patch.bz2 ; do bzcat $i | patch -Np1 ; done &&
export SRC=$PWD
export ALT_BOOTDIR="$JAVA_HOME"
export ALT_MOZILLA_PATH=$SRC
export ALT_DEVTOOLS_PATH="/usr/bin"
export ALT_MOTIF_DIR=$SRC/motif
export MILESTONE="lfscompiled"
export BUILD_NUMBER=`date +%s`
export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts
export DEV_ONLY=true
#export OTHER_LDFLAGS="-lpthread"
unset JAVA_HOME
unset CLASSPATH
#export OTHER_CFLAGS=$CFLAGS
#export OTHER_CXXFLAGS=$CXXFLAGS
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export INSANE=true
for i in hotspot/build/linux/makefiles/gcc.make \
hotspot/build/solaris/makefiles/gcc.make \
j2se/make/sun/image/generic/Makefile
do
chmod +w $i
cp $i $i.orig
sed -e "s:\-O3:\-march=i686 \-fomit\-frame\-pointer \-s:g" \
$i.orig > $i
done
ZLIB_VERSION=1.1.4 &&
cd $SRC/j2se/src/share/native/java/util/zip &&
rm -rf $SRC/zlib-1.1.3 &&
tar -xvjf $SRC/../zlib-${ZLIB_VERSION}.tar.* &&
cd zlib-${ZLIB_VERSION} &&
mv adler32.c zadler32.c &&
mv crc32.c zcrc32.c &&
cd $SRC/j2se/make/java/zip/ &&
cp Makefile Makefile.orig &&
chmod +w Makefile &&
sed -e "s:1.1.3:${ZLIB_VERSION}:" Makefile.orig > Makefile &&
cd $SRC/control/make &&
make &&
cd $SRC/control/build/linux-i386 &&
mkdir -p /opt/java &&
cp -a j2sdk-image /opt/java/j2sdk-1.4.1 &&
cd /opt/java &&
ln -nsf j2sdk-1.4.1 j2sdk
I have a build directory which contains the following files:
binary
buildit
j2sdk-1.4.1-fix-intl-files.patch.bz2
j2sdk-1.4.1-link-missing-libs.patch.bz2
j2sdk-1.4.1-remove-fixed-paths.patch.bz2
j2sdk-1.4.1-syntax-fixes.patch.bz2
j2sdk-1.4.1-use-included-motif.patch.bz2
j2sdk-1_4_1-mozilla_headers-unix.zip
j2sdk-1_4_1-src-scsl.zip
zlib-1.1.4.tar.bz2
The binary is a link to where I placed the binary version of java. Hope you manage to have better luck.
Well I finally managed to get it compiled. I had to set a few links to /usr/X11R6. The BLFS book tells you all about that but I didn't follow the book. Well after that I still ran into some troubles when it tried to remove the Xm directory. So I modified the motif patch so it would also stop trying to remove that directory. I've only tried one site with Java so far but it seems to work nicely now. Just got to figure out how to get it working for a normal user now. It only loads it as root. Probably some stupid permissions problem.
Hope you manage to get the same results.
Yeah I got exactly the same error. I solved it by modifying the file control/make/motif-rules.gmk and removing the lines where it tries to remove the directory and create the link. I modified the original motif patch to include removing those two lines. You can get the patch I made here:
If you use that patch then don't use the j2sdk-1.4.1-use-included-motif.patch.bz2 anymore.
Yes the plugin does work good now. I just removed the users ~/.mozilla directory and then it worked for the normal user again. That also removes all the settings and probably wasn't really necessary but I didn't feel like figure it out further since it just worked.
I see you've also posted a message on the mailing list. And tushar suggested to unset the ALT_MOTIF_DIR variable. I've tried unsetting that before and then it didn't even try to compile motif, which ended up in it complaining that it couldn't find the motif library to link with. So I had to set it for it to force the compilation of motif. But maybe that was because I had some other things set wrong before. I haven't tried it after adding the links to /usr/X11R6.
Have managed to get it done - thanks alot for the help. I have updated your script with global variables so if anyone would like to have a template for compiling Java 1.4.1 from scratch they can follow it. Thanka again Mik.
BTW - I unset the ALT_MOTIF_DIR variable and it worked, so I'm not sure why it didn't for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.