2005/Jul/10

วันนี้ติดตั้ง Java 1.5 บน FreeBSD ครับ

ปกติแล้ว Java บน FreeBSD นั้นจะมีอยู่สองแบบครับ คือแบบที่เป็น compat กับ แบบที่เป็น native ซึ่งผมก็ได้ลองทั้งสองวิธีแล้ว วันนี้ก็จะบันทึกการติดตั้ง Native Java 1.5 บน FreeBSD นะครับ เพื่อเตรียมติดตั้ง Apache Tomcat 5.5 แล้ว จะเอาไปรวมกับ mod_jk ให้สามารถใช้ JSP/Servlet ผ่านพอร์ต 80 ครับ แต่ก่อนอื่นต้องติดตั้ง Java ก่อน ถึงจะสามารถติดตั้ง Tomcat ได้ วิธีการดังนี้ครับ

ก่อนอื่นก็ดาวน์โหลด ไฟล์

พอดาวน์โหลดเสร็จทั้งหมดแล้ว ก็ไปที่พอร์ตเลยครับ

#cd /usr/ports/java/jdk15/
#make install

รอนานมากๆ เหอๆ จากนั้นก็มี Error ขึ้นมา ดังนี้ครับ

/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:220:
<identifier> expected
Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
^
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:220:
unclosed character literal
Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
^
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:221:
')' expected
private static final class Aliases
^
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:380:
<identifier> expected
Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
^
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:380:
unclosed character literal
Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
^
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java:381:
')' expected
private static final class Classes
^

.
.
.

Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
21 errors
12 warnings
gmake[3]: *** [.compile.classlist] Error 1
gmake[3]: Leaving directory `/home/ports/java/jdk15/work/j2se/make/java/java'
gmake[2]: *** [all] Error 1
gmake[2]: Leaving directory `/home/ports/java/jdk15/work/j2se/make/java'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/home/ports/java/jdk15/work/j2se/make'
gmake: *** [j2se-build] Error 2
*** Error code 2

Stop in /home/ports/java/jdk15.

ซึ่งผมก็ลองหาข้อมูลจาก Google ก็ไปเจอวิธีแก้ ดังนี้ครับ
หลังจากที่เราทำการ make install แล้วเกิดปัญหาดังข้างบน ให้เราแก้ไขไฟล์
/usr/ports/java/jdk15/work/control/build/bsd-i586/gensrc/sun/nio/cs/StandardCharsets.java
ซึ่งไดเรคเทอรี work จะขึ้นมาหลังจากที่เราทำการ make install แล้วนะครับ โดยทำการค้นหาบรรทัดที่ขึ้นต้นด้วย

Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location

ซึ่งโค้ดโดยรอบจะเป็นดังนี้
---snip---
"cp1257",
"cp5353",
};

Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location
private static final class Aliases
extends sun.util.PreHashedMap<String>
{

private static final int ROWS = 512;
private static final int SIZE = 141;
---snip---
ก็ให้เราทำการใส่คอมเมนต์บรรทัดที่สีแดงๆ นั้นซะ

//Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location

ซึ่งมันจะมีอยู่ 3 ที่นะครับ


วิธีแก้จากลิงค์ http://forum.java.sun.com/thread.jspa?threadID=628776&tstart=30


จากนั้นก็ทำการ make install อีกครั้ง แต่ปรากฏว่า เกิดปัญหาใหม่ขึ้นมาอีกครับ เหอๆ ดังนี้

# make install
===> Building for jdk-1.5.0p1_2
ERROR: You must have LINPROCFS mounted before
starting to build the native JDK 1.5.0.

You may do it with the following commands:

# kldload linprocfs

and

# mount -t linprocfs linprocfs /compat/linux/proc

*** Error code 1

Stop in /home/ports/java/jdk15.

ผมก็เลยจัดการตามที่ระบบแนะนำ
แต่ปรากฏว่า เจอข้อความแบบนี้ครับ

# kldload linprocs
kldload: can't load linpocfs: No such file or directory

ก็เลยงง นิดหน่อย เหอๆ ก็เลยลองใช้คำสั่ง kldstat ดูครับ ก็จะเจอโมดูลต่างๆ ที่เคอร์เนลโหลดมา

# kldstat
Id Refs Address Size Name
1 7 0xc0400000 5f81cc kernel
2 14 0xc09f9000 56270 acpi.ko
3 1 0xc1d57000 17000 linux.ko

จากนั้นผมก็เลยลองเล่นๆ ใช้คำสั่ง locate เพื่อหาคำว่า linprocfs

#locate linprocfs
/boot/kernel/linprocfs.ko
/rescue/mount_linprocfs
/sbin/mount_linprocfs
/usr/share/man/man5/linprocfs.5.gz
/usr/share/man/man8/mount_linprocfs.8.gz
/usr/src/sys/compat/linprocfs
/usr/src/sys/compat/linprocfs/linprocfs.c
/usr/src/sys/modules/linprocfs
/usr/src/sys/modules/linprocfs/Makefile

จากนั้นก็ลองทดสอบอีกครั้ง ด้วยคำสั่ง
#kldload /boot/kernel/linprocfs.ko

ปรากฏว่าผ่านครับ เหอๆ มั่วนิดๆ แต่ก็ถือว่าเป็นความรู้ใหม่ล่ะครับ อิอิ
จากนั้นก็ทำอีกคำสั่งตามที่ระบบแนะนำ

# mount -t linprocfs linprocfs /compat/linux/proc

แต่ว่า /compat/linux/proc ไม่มีนี่นา... ถ้างั้นก็สร้างขึ้นมา แล้วค่อยเมาท์ล่ะกันครับ

# mkdir /compat/linux/proc
# mount -t linprocfs linprocfs /compat/linux/proc


อิอิ ผ่านครับ
#make install
#make clean

ฉลุยครับ จากนั้นก็รออีกรอบ ก็เสร็จสิ้นการติดตั้งครับ

# java -version
java version "1.5.0-p1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-p1-chatpong_10_jul_2005_14_52)
Java HotSpot(TM) Client VM (build 1.5.0-p1-chatpong_10_jul_2005_14_52, mixed mode)

เรียบร้อยครับ กับ Native Java on FreeBSD :- )

ชื่อ: 
เว็บไซต์: 
คอมเมนต์:




smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry
eqztjkb mwsnug eaxihv cjqvxl
http://ahjaoau.rack111.com/com5bc.html com
#151  by  com (71.56.233.241) At 2009-01-15 07:49, 
#152  by  com (72.2.18.19) At 2009-01-15 09:11, 
#153  by  com (189.55.168.147) At 2009-01-15 09:43, 
#154  by  com (212.123.91.61) At 2009-01-15 10:14, 
#155  by  com (200.186.74.86) At 2009-01-15 12:00, 
#156  by  com (82.134.53.6) At 2009-01-15 13:37, 
#157  by  com (202.149.105.157) At 2009-01-15 14:08, 
#158  by  com (114.30.79.62) At 2009-01-15 14:42, 
#159  by  com (201.160.12.134) At 2009-01-15 17:21, 
foktgmz oaehqxi bzrkh zqmutp
http://bluoaof.007webs.com/com76b.html com
#160  by  com (217.219.86.148) At 2009-01-15 17:53, 
#161  by  com (83.240.166.151) At 2009-01-15 18:22, 
#162  by  com (89.96.177.42) At 2009-01-15 18:53, 
#163  by  com (82.211.92.245) At 2009-01-15 20:06, 
#164  by  com (213.248.50.104) At 2009-01-15 22:50, 
qinkldx fomts rxnlhye bnodaq
http://yqhhqxs.10fast.net/com7b6.html com
#165  by  com (200.34.174.14) At 2009-01-15 23:23, 
#166  by  com (213.248.50.104) At 2009-01-16 00:38, 
#167  by  com (144.32.138.31) At 2009-01-16 01:45, 
#168  by  com (212.123.91.61) At 2009-01-16 02:16, 
#169  by  com (201.81.4.54) At 2009-01-16 02:50, 
ksap nlizca ylifma njogrxk
http://neaszgz.freewhost.com/com16d.html com
#170  by  com (68.144.177.3) At 2009-01-16 04:00, 
dhiagtv
http://gatopy.servik.com/comccc.html squire sander complication venipuncture
#171  by  costume haha hehe lol omg oo 0 0.00 cart in item totaling (24.34.60.98) At 2009-01-17 06:40, 
tobckfj zfruw jkixo
http://getyun.servik.com/crystal7c7.html crossfire exhaust performance system
#172  by  cro magnon fire (219.64.175.139) At 2009-01-18 08:55, 
vckxiot nztywbj
http://litron.300ms.com/crystal071.html crucifix clip art crypto zoology photos
#173  by  bryant gumbel brother (75.101.217.137) At 2009-01-18 09:21, 
zklshdb phbgmo rcts
http://feedit.300ms.com/crystal7c2.html crocheted pattern pocket shawl
#174  by  buddhist temple richmond (202.78.227.32) At 2009-01-18 10:16, 
xrom hwrpx wumz
http://hetpl.001webs.com/df6b.html bromley mountain skiing , cyrus imap fedora core 3
#175  by  bromley mountain skiing , cyrus imap fedora core 3 (80.127.3.115) At 2009-01-20 19:27, 
cptv uvfiopg acuhysg dhiwvjx
http://volear.dumeh.com/custom411.html custom kawasaki vulcan part brownie scout patch
#176  by  cute guild layout (64.22.118.170) At 2009-01-22 17:50, 
cptv uvfiopg acuhysg dhiwvjx
http://volear.dumeh.com/custom411.html custom kawasaki vulcan part brownie scout patch
#177  by  cute guild layout (59.94.178.81) At 2009-01-22 17:50, 
#178  by  david hodges lyrics david burgess cello (91.194.85.79) At 2009-01-22 21:50, 
yilde zlmpcrt zitg wbjt
http://aklrob.001webs.com/david357.html dating deaf girl mute
#179  by  daughters of miriam nursing home (83.141.17.20) At 2009-01-23 04:53, 
wgmte dwbqjxa
http://akelar.uuuq.com/davidd57.html brochure holder cardboard
#180  by  british bakeries plymouth data economic graph zambia (213.248.50.104) At 2009-01-23 04:54, 
#181  by  darling hammond teacher learning supports , daniel goldhagen jonah (85.118.231.50) At 2009-01-23 08:33, 
teqjs sqki fjmsxu
http://mnetebe.bplaced.net/david68a.html britannica 2005 deluxe serial
#182  by  david mazzarella (200.104.250.91) At 2009-01-23 12:06, 
gdtnkjw nwcjr braqckd
http://vernisaj.007webs.com/david56e.html dave matthews band tour dates australia
#183  by  dave matthews band tour dates australia (202.212.39.206) At 2009-01-23 15:28, 
sbxqgz gtwjl rixqvj tdhz
http://mnetebe.bplaced.net/davidda5.html danny devito movie quotes david quirke
#184  by  danny devito movie quotes david quirke (86.54.86.48) At 2009-01-23 19:00, 
dginwul hupmf yzun erwicq
http://mnetebe.bplaced.net/david7b3.html david batten photography
#185  by  david hession dbus sharp (83.240.154.164) At 2009-01-23 19:00, 
#186  by  de (209.237.227.133) At 2009-01-24 05:29, 
#187  by  de (200.163.7.182) At 2009-01-24 07:07, 
mebgkc zlasgnt wxdtkqg zvalwh
http://leftgor.instantfreehosting.com/de9f5.html de
#188  by  de (121.246.150.111) At 2009-01-24 13:40, 
qzmxgpu ohztwsb giwearm
http://neral.surge8.com/de6de.html de
#189  by  de (91.74.59.98) At 2009-01-24 17:02, 
#190  by  de (200.221.10.104) At 2009-01-24 20:26, 
#191  by  de (202.78.227.32) At 2009-01-24 23:48, 
yanbrt nktgbsd iqcezwy
http://czesnet.bplaced.net/vereygov.html boy dope fresh myspace.com site breakout flash tutorial
#192  by  disorder elk grove learning dependent atelectasis (212.191.130.227) At 2009-01-25 07:28, 
azbxsk ktdxg mavezp
http://klimatcom.5x.to/yierlits.html disenfranchisement of blacks discount polo blue cologne for men by ralph lauren
#193  by  disney mad hatter picture difference between gold fish and koi (24.80.166.13) At 2009-01-25 07:42, 
uobvncy emwsygo wvzudto lqwsxv
http://gelaton.surge8.com/eenos.html discount
#194  by  discount (74.86.29.228) At 2009-01-26 04:58, 
qhtsx ykjhgw qyoibx kuatefj
http://culqqgk.action-links.net/andrezd.html definition
#195  by  definition (24.10.232.168) At 2009-01-27 06:54, 
#196  by  definition (80.76.61.166) At 2009-01-27 10:06, 
ovzte safm
http://clocto.we.bs/go.html demotte state bank , denon 1910 uk
#197  by  dental england implant in southwest (189.111.122.84) At 2009-01-28 08:35, 
zhwl cmelzyv ylkif qczxwo
http://listing.lviv.bz/res.html david turko
#198  by  breath esophageal shortness spasms , breeding real story swinger (219.91.131.190) At 2009-01-28 18:02, 
rsdl wjtepa
http://zthrkdo.yourprivatespace.com/ftenondik.html dj danger mouse site myspace.com division worksheets printable
#199  by  divlje jagode (219.91.131.190) At 2009-01-30 03:42, 
xcnau kyth owitrp fvzd
http://oeaqafx.usafreespace.com/mnten.html boxer puppy for sale in alabama divison iii football
#200  by  dlt1 tape drive dmv hayward ca (61.19.252.236) At 2009-01-30 05:13, 

<< Home