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 :- )

Comment

Comment:

Tweet


Beautiful site, http://www.formspring.me/diovanhere diovan, :-P,
#1866 by XNvicOHCmoCtGV (91.214.44.182) At 2010-08-11 08:56,
Beautiful site, http://connect.syracuse.com/user/transparentbikini/index.html transparent bikini, himcrs,
#1865 by agFtXNLvY (91.214.44.182) At 2010-08-11 08:49,
Thank you, <a href= http://www.formspring.me/darvocets#1 >darvocet free</a> [url=http://www.formspring.me/darvocets#1]darvocet free[/url], %-(((,
#1864 by LXkLdULmX (91.214.44.182) At 2010-08-11 08:26,
Only, <a href= http://connect.syracuse.com/user/watchmywife/index.html#1 >watch my wife</a> [url=http://connect.syracuse.com/user/watchmywife/index.html#1]watch my wife[/url], >:-(((,
#1863 by UalNqkLvhYTpRrPGKF (91.214.44.182) At 2010-08-11 08:19,
Give somebody the to a site about the, <a href= http://www.formspring.me/ariceptsnow >First aricept</a>, [url= http://www.formspring.me/ariceptsnow ]First aricept[/url], 62391,
#1862 by wHlsAxbXI (91.214.44.182) At 2010-08-11 08:11,
Best Wishes, <a href= http://connect.syracuse.com/user/canadiannationaldebtclock/index.html >canadian national debt clock for you</a>, [url= http://connect.syracuse.com/user/canadiannationaldebtclock/index.html ]canadian national debt clock for you[/url], ceylra,
#1861 by OKXFuMeSQhEkfdyAq (91.214.44.182) At 2010-08-11 08:04,
Give somebody the to a site about the, http://connect.syracuse.com/user/christiandebtconsolidation/index.html christian debt consolidation online, jppgme,
#1860 by nVHwhZQAp (91.214.44.182) At 2010-08-11 07:49,
Best Wishes, http://www.formspring.me/bbwsex Discount bbw sex, 725436,
#1859 by vvqssZnlcVnF (91.214.44.182) At 2010-08-11 07:41,
Only, <a href= http://connect.syracuse.com/user/paycapitalonecreditcardbill/index.html#1 >pay capital one credit card bill for you</a> [url=http://connect.syracuse.com/user/paycapitalonecreditcardbill/index.html#1]pay capital one credit card bill for you[/url], tpghg,
#1858 by JWJfqWkSt (91.214.44.182) At 2010-08-11 07:34,
Great site. Keep doing., <a href= http://www.formspring.me/shemalesex >shemale sex price</a>, [url= http://www.formspring.me/shemalesex ]shemale sex price[/url], izk,
#1857 by OuxPWzlKWw (91.214.44.182) At 2010-08-11 07:26,
Your Site Is Great, http://connect.syracuse.com/user/debtcures/index.html debt cures now, >:-[[[,
#1856 by NRAfWatHxa (91.214.44.182) At 2010-08-11 07:18,
can you do thi for me, <a href= http://www.formspring.me/grannysex >interracial sex</a>, [url= http://www.formspring.me/grannysex ]interracial sex[/url], xzqu,
#1855 by ONeMsRFmtblPZNvUao (91.214.44.182) At 2010-08-11 07:11,
Thank you, http://connect.syracuse.com/user/debtsettlement/index.html debt settlement information, %O,
#1854 by sNzmIhDELCTxzNprB (91.214.44.182) At 2010-08-11 07:03,
can you do thi for me, <a href= http://www.formspring.me/grannysex >granny sex</a>, [url= http://www.formspring.me/grannysex ]granny sex[/url], 76271,
#1853 by qHnOqWnmoQPZp (91.214.44.182) At 2010-08-11 06:55,
Give somebody the to a site about the, <a href= http://connect.syracuse.com/user/insurancesamplecancellationletter/index.html#1 >insurance sample cancellation letter</a> [url=http://connect.syracuse.com/user/insurancesamplecancellationletter/index.html#1]insurance sample cancellation letter[/url], 566683,
#1852 by sEidczhUyXMjyz (91.214.44.182) At 2010-08-11 06:48,
It is a very good thing, <a href= http://www.formspring.me/webcamsexed >Cheapest web cam sex</a>, [url= http://www.formspring.me/webcamsexed ]Cheapest web cam sex[/url], 8]],
#1851 by EfbOGNCTDQTzGCbK (91.214.44.182) At 2010-08-11 06:40,
Nice, <a href= http://connect.syracuse.com/user/gropingtrain/index.html >groping train</a>, [url= http://connect.syracuse.com/user/gropingtrain/index.html ]groping train[/url], 517632,
#1850 by UGcaeXgKQVImznxC (91.214.44.182) At 2010-08-11 06:33,
Help me to find the, http://www.formspring.me/amyfishersextap amy fisher sex tape free, retn,
#1849 by yjkiQgWkvTL (91.214.44.182) At 2010-08-11 06:25,
Perfect work, <a href= http://connect.syracuse.com/dashboard/replicarolexwatch/index.html >replica rolex watches for you</a>, [url= http://connect.syracuse.com/dashboard/replicarolexwatch/index.html ]replica rolex watches for you[/url], 8784,
#1848 by cgsuBkUPVXFBieYJ (91.214.44.182) At 2010-08-11 06:17,
What is it, <a href= http://www.formspring.me/jenniriverasext >Best jenni rivera sex tape</a>, [url= http://www.formspring.me/jenniriverasext ]Best jenni rivera sex tape[/url], 531,
#1847 by uwAUFTecUjWgDkRJ (91.214.44.182) At 2010-08-11 06:10,
Best, <a href= http://connect.syracuse.com/user/replicadesignerhandbags/index.html >replica designer handbags now</a>, [url= http://connect.syracuse.com/user/replicadesignerhandbags/index.html ]replica designer handbags now[/url], 199455,
#1846 by SGQQHPraObyzvyXM (91.214.44.182) At 2010-08-11 06:03,
I bookmarked this guestbook., http://www.formspring.me/adrianalimasext adriana lima sex tape price, giv,
#1845 by rzOYOLCZqwyvklEpLQ (91.214.44.182) At 2010-08-11 05:55,
Real, <a href= http://connect.syracuse.com/user/replicacoachpurses/index.html >Cheap replica coach purses</a>, [url= http://connect.syracuse.com/user/replicacoachpurses/index.html ]Cheap replica coach purses[/url], 8DDD,
#1844 by ksUbTDwAABFZJcaUkNB (91.214.44.182) At 2010-08-11 05:48,
Best Wishes!, <a href= http://www.formspring.me/alysonhannigans >alyson hannigan sex tape price</a>, [url= http://www.formspring.me/alysonhannigans ]alyson hannigan sex tape price[/url], 686934,
#1843 by MmqQihhGyrul (91.214.44.182) At 2010-08-11 05:40,
Real, <a href= http://connect.syracuse.com/user/coachpurses/index.html#1 >Only coach purses</a> [url=http://connect.syracuse.com/user/coachpurses/index.html#1]Only coach purses[/url], 4511,
#1842 by rDIpvFyLfpUemxBuA (91.214.44.182) At 2010-08-11 05:33,
So where it to find, http://www.formspring.me/noeliasextape noelia sex tape for you, 550,
#1841 by tzGPdeRIlNWSTAa (91.214.44.182) At 2010-08-11 05:02,
I want to say thanks!, <a href= http://connect.syracuse.com/user/knockoffdesignerpursess/index.html >knock off designer purses</a>, [url= http://connect.syracuse.com/user/knockoffdesignerpursess/index.html ]knock off designer purses[/url], 78289,
#1840 by WfyIsxdF (91.214.44.182) At 2010-08-11 04:55,
Your Site Is Great, http://connect.syracuse.com/user/knockoffcoachpurses/index.html knock off coach purses, 361546,
#1839 by rFabUXTPdApYsKV (91.214.44.182) At 2010-08-11 04:47,
Your Site Is Great, http://www.formspring.me/lindsaylohansex lindsay lohan sex tape, 5175,
#1838 by EqcYOAmABDO (91.214.44.182) At 2010-08-11 04:39,
Nise site, <a href= http://connect.syracuse.com/user/indianreservationcigarettes/index.html >indian reservation cigarettes for you</a>, [url= http://connect.syracuse.com/user/indianreservationcigarettes/index.html ]indian reservation cigarettes for you[/url], 4814,
#1837 by QgtOvmXKvmpOeMIsT (91.214.44.182) At 2010-08-11 04:32,
Thank you, http://www.formspring.me/jessicasimpsons jessica simpson sex tape price, 618,
#1836 by UUPofkzrbY (91.214.44.182) At 2010-08-11 04:24,
Your Site Is Great, <a href= http://connect.syracuse.com/user/cheapcigarette/index.html >cheap cigarettes</a>, [url= http://connect.syracuse.com/user/cheapcigarette/index.html ]cheap cigarettes[/url], wgf,
#1835 by nQZYckONvf (91.214.44.182) At 2010-08-11 04:17,
Where it is possible to buy the, <a href= http://connect.syracuse.com/user/shortskirtgallery/index.html >short skirt gallery</a>, [url= http://connect.syracuse.com/user/shortskirtgallery/index.html ]short skirt gallery[/url], dczomy,
#1834 by vGsWqKEcpaERC (91.214.44.182) At 2010-08-11 04:01,
:-), <a href= http://connect.syracuse.com/user/VERYSHORTSKIRTS/index.html#1 >very short skirts information</a> [url=http://connect.syracuse.com/user/VERYSHORTSKIRTS/index.html#1]very short skirts information[/url], nvals,
#1833 by ndyOvDLlZO (91.214.44.182) At 2010-08-11 03:46,
What is it, http://www.formspring.me/carmenelectrase First carmen electra sex tape, 4306,
#1832 by lRuYuQGWrvioTE (91.214.44.182) At 2010-08-11 03:38,
Nice, http://connect.syracuse.com/user/supercheapairplanetickets/index.html Real super cheap airplane tickets, :-OOO,
#1831 by hlTWCjSIhcOKzdvfC (91.214.44.182) At 2010-08-11 03:31,
What is it, http://www.formspring.me/britneyspearsse Discount britney spears sex tape, :-DD,
#1830 by TFHHcOhPFitRoblcvf (91.214.44.182) At 2010-08-11 03:23,
Real, <a href= http://connect.syracuse.com/user/dirtcheapairlinetickets/index.html#1 >dirt cheap airline tickets now</a> [url=http://connect.syracuse.com/user/dirtcheapairlinetickets/index.html#1]dirt cheap airline tickets now[/url], slr,
#1829 by yQQymCSXBRiYvIBfG (91.214.44.182) At 2010-08-11 03:08,
Is it so important?, http://www.formspring.me/celebritysextap celebrity sex tapes, =]],
#1828 by ZVkcoWvjZo (91.214.44.182) At 2010-08-11 02:51,
Your Site Is Great!, http://connect.syracuse.com/user/airlinediscountticketmilitary/index.html Cheapest airline discount ticket military, kciu,
#1827 by vzkWMWDtxpk (91.214.44.182) At 2010-08-11 02:35,
best for you, http://www.formspring.me/carrieprejeanse Best carrie prejean sex tape, 8P,
#1826 by xEGbESjdajg (91.214.44.182) At 2010-08-11 02:19,
Great site. Keep doing., <a href= http://connect.syracuse.com/user/airlinediscountstudentticket/index.html#1 >airline discount student ticket online</a> [url=http://connect.syracuse.com/user/airlinediscountstudentticket/index.html#1]airline discount student ticket online[/url], %-[[[,
#1825 by kyKZUaUhP (91.214.44.182) At 2010-08-11 02:06,
I have the same., <a href= http://connect.syracuse.com/user/studentloanforgiveness/index.html >Only student loan forgiveness</a>, [url= http://connect.syracuse.com/user/studentloanforgiveness/index.html ]Only student loan forgiveness[/url], >:]],
#1824 by DNAmheTYrLXtASNwOX (91.214.44.182) At 2010-08-11 01:51,
I bookmarked this guestbook., http://www.formspring.me/rayjsextape ray j sex tape, 0916,
#1823 by MDYsSATnVlx (91.214.44.182) At 2010-08-11 01:43,
Great, <a href= http://connect.syracuse.com/user/simpleinterestloancalculator/index.html >simple interest loan calculator information</a>, [url= http://connect.syracuse.com/user/simpleinterestloancalculator/index.html ]simple interest loan calculator information[/url], xjteu,
#1822 by TgJCWAZVuTawKVTI (91.214.44.182) At 2010-08-11 01:35,
Best Wishes!, http://www.formspring.me/parishiltonsext paris hilton sex tape information, 13818,
#1821 by yXFszhEANXSlljx (91.214.44.182) At 2010-08-11 01:28,
Is it so important?, http://connect.syracuse.com/user/mortgageratespredictions/index.html mortgage rates predictions discount, 955954,
#1820 by KvADxTGOuSnZ (91.214.44.182) At 2010-08-11 01:20,
Best Wishes, <a href= http://www.formspring.me/kimkardashianse#1 >Buy kim kardashian sex tape</a> [url=http://www.formspring.me/kimkardashianse#1]Buy kim kardashian sex tape[/url], 037,
#1819 by zOYUwKNNLxiEgOLo (91.214.44.182) At 2010-08-11 01:13,
I want to say thanks!, <a href= http://trig.com/buyhydrocodone/biography >buy hydrocodone</a>, [url= http://trig.com/buyhydrocodone/biography ]buy hydrocodone[/url], 799,
#1818 by uCVlEtMynnKVqHlJPP (91.214.44.182) At 2010-08-08 08:42,
Real, <a href= http://trig.com/buyhydrocodone/biography#1 >Best buy hydrocodone</a> [url=http://trig.com/buyhydrocodone/biography#1]Best buy hydrocodone[/url], %-P,
#1817 by ozMwoNyKcQJvOVD (91.214.44.182) At 2010-08-08 08:35,