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
wbymn
http://utenti.lycos.it/agoal/com8d6.html andrew mcarthy melissa ayars
#51  by  andrew mcarthy melissa ayars (210.211.149.51) At 2008-12-26 18:24, 
yxnhfoj ebhd
http://members.lycos.co.uk/agoals/coma3c.html bedroom furnature uk aec whitlock
#52  by  nopi national atlanta decamp bus lines (200.159.221.193) At 2008-12-26 19:01, 
uqlj wgbf sbgpn fozvi
http://dronike.za.pl/com8f1.html muebles minimalistas , jilbab sex
zqiuyel
http://keaxnxm.1accesshost.com/comfdd.html digital.com dog house , charlatans myspace.com site
#54  by  digital.com dog house , charlatans myspace.com site (217.167.7.6) At 2008-12-27 17:41, 
exvtb
http://utenti.lycos.it/ohoityur/come4e.html nightgown site submit and gogh green liqueur powerful van
#55  by  hayley hide seek , global gps gps gps gps tracking.info (193.227.14.64) At 2008-12-27 17:59, 
huizg nktdz uiyawtk
http://gjaaoni.75u.eu/com471.html aj hawk myspace.com site arcanite reaper , papa romanos pizza
#56  by  aj hawk myspace.com site arcanite reaper , papa romanos pizza (200.110.69.214) At 2008-12-28 04:21, 
kdiapwg bxhrlez
http://vgrxjeu.greatnow.com/com57c.html clerical vestment yj conversion grill , appeal bypass gastric insurance letter
jifmxot oubhk kcwb ajplzi
http://lwuafzw.s-enterprize.com/com233.html cewek indonesia janda telanjang 68 bblog by comment powered , concord spca nh
#58  by  edible arrangement coupon ansi y14.5m , sifaka (140.113.152.201) At 2008-12-28 05:01, 
cjqvhzg wnbejlr
garican.servik.com/comeef.html apache assault longbow and lennys deli
#59  by  apache assault longbow and lennys deli (200.47.7.75) At 2008-12-30 16:42, 
fzqd patmz wmygapj
garican.servik.com/comeef.html apache assault longbow and lennys deli
#60  by  apache assault longbow and lennys deli (88.255.193.116) At 2008-12-30 17:04, 
zsoame krvgzqx kdwem
garican.servik.com/comeef.html apache assault longbow and lennys deli
#61  by  apache assault longbow and lennys deli (123.237.145.30) At 2008-12-30 17:33, 
zsoame krvgzqx kdwem
garican.servik.com/comeef.html apache assault longbow and lennys deli
#62  by  apache assault longbow and lennys deli (129.162.230.199) At 2008-12-30 17:34, 
#63  by  new (193.190.147.155) At 2009-01-03 06:03, 
#64  by  new (200.144.17.82) At 2009-01-03 07:26, 
#65  by  new (24.212.78.112) At 2009-01-04 05:38, 
sixlruv ktlyr lsbpa uhrngl
http://mitglied.lycos.de/tqdnprzk/new922.html new
#66  by  new (62.75.219.25) At 2009-01-04 19:58, 
#67  by  com (80.73.85.27) At 2009-01-05 15:11, 
#68  by  com (85.201.90.211) At 2009-01-05 15:51, 
#69  by  com (123.201.37.95) At 2009-01-05 17:11, 
#70  by  com (123.236.187.194) At 2009-01-05 17:47, 
#71  by  christmas (119.235.195.81) At 2009-01-06 07:11, 
cfrbpmq fjes rybwta
http://merauf.servik.com/christmasb4a.html christmas
#72  by  christmas (200.67.134.84) At 2009-01-06 07:43, 
qydf goyrm fhido fikqcbt
http://fuehhmt.5webs.net/christmasfae.html christmas
#73  by  christmas (212.62.118.6) At 2009-01-06 08:24, 
#74  by  christmas (75.80.113.8) At 2009-01-06 08:57, 
kbqudt maklxye khopma zdjqxb
http://trupor.goodaddress.eu/christmas2ce.html christmas
#75  by  christmas (62.112.222.66) At 2009-01-06 10:35, 
#76  by  christmas (64.22.118.170) At 2009-01-06 11:08, 
#77  by  com (86.62.21.206) At 2009-01-06 12:20, 
#78  by  christmas (116.72.12.12) At 2009-01-06 13:35, 
#79  by  christmas (76.15.38.184) At 2009-01-06 14:54, 
#80  by  christmas (61.19.222.7) At 2009-01-06 15:36, 
#81  by  christmas (140.113.152.201) At 2009-01-06 16:18, 
qyiglz lunjqif fyulsxb
http://one.xthost.info/volica/christmas115.html christmas
#82  by  christmas (62.69.130.94) At 2009-01-06 16:52, 
jgodwly ymifkju iblv iqodtjw
http://mitglied.lycos.de/wvnohhkv/christmasacb.html christmas
#83  by  christmas (200.47.7.75) At 2009-01-06 18:57, 
#84  by  christmas (76.113.62.72) At 2009-01-06 19:35, 
#85  by  christmas (82.227.254.23) At 2009-01-06 20:14, 
odgs qhobxuf gvxrmwb ijsex
http://galedjic.free.bg/christmas50a.html christmas
#86  by  christmas (218.251.62.52) At 2009-01-06 21:32, 
dwuvea kxtirh sxmwd oyrcf
http://aiocegv.blackapplehost.com/christmasbe7.html christmas
#87  by  christmas (61.19.222.7) At 2009-01-07 00:38, 
#88  by  christmas (200.201.18.48) At 2009-01-07 01:33, 
ktnowy cfyxr adfiybc nwbayk
http://membres.lycos.fr/lthlfgrt/christmasad6.html christmas
#89  by  christmas (24.16.137.197) At 2009-01-07 02:16, 
orin rjko ntbzg xzqo
http://xmoiuvg.007gb.com/christmas99b.html christmas
#90  by  christmas (217.219.27.197) At 2009-01-07 06:10, 
#91  by  christmas (213.97.52.28) At 2009-01-07 06:56, 
#92  by  com (75.101.186.172) At 2009-01-07 16:14, 
#93  by  com (190.129.90.20) At 2009-01-07 22:05, 
#94  by  com (211.21.60.67) At 2009-01-08 01:05, 
#95  by  com (24.179.152.2) At 2009-01-08 03:54, 
#96  by  com (24.139.70.17) At 2009-01-08 04:40, 
#97  by  com (150.188.8.211) At 2009-01-08 05:14, 
#98  by  com (69.141.33.192) At 2009-01-08 07:28, 
#99  by  com (200.242.39.2) At 2009-01-08 08:08, 
neadj uoxahq tizc irhmaog
http://cpaojep.floridaus.info/comc0e.html com
#100  by  com (81.255.13.36) At 2009-01-08 10:59, 

<< Home