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


Only, <a href= http://trig.com/jenniriverasextape/biography >jenni rivera sex tape online</a>, [url= http://trig.com/jenniriverasextape/biography ]jenni rivera sex tape online[/url], 28603,
#1916 by alcFPncpPBgrnUsC (91.214.44.182) At 2010-08-11 16:25,
I bookmarked this guestbook., <a href= http://connect.syracuse.com/user/adrianalimasextape/index.html#1 >adriana lima sex tape</a> [url=http://connect.syracuse.com/user/adrianalimasextape/index.html#1]adriana lima sex tape[/url], %-(((,
#1915 by drhXuhUennJG (91.214.44.182) At 2010-08-11 16:17,
I want to say thanks!, http://connect.syracuse.com/user/alysonhannigansextape/index.html Buy alyson hannigan sex tape, :-D,
#1914 by JodkaGiUzeD (91.214.44.182) At 2010-08-11 16:02,
Your Site Is Great, <a href= http://trig.com/alysonhannigansextape/biography#1 >alyson hannigan sex tape</a> [url=http://trig.com/alysonhannigansextape/biography#1]alyson hannigan sex tape[/url], :-OOO,
#1913 by pPJZKKnBNreOHq (91.214.44.182) At 2010-08-11 15:54,
Very interesting sites., http://connect.syracuse.com/user/kristindavissextape/index.html Discount kristin davis sex tape, 401,
#1912 by EqvykRqIF (91.214.44.182) At 2010-08-11 15:47,
Your Site Is Great, <a href= http://trig.com/kristindavissextape/biography >kristin davis sex tape price</a>, [url= http://trig.com/kristindavissextape/biography ]kristin davis sex tape price[/url], pwux,
#1911 by ACzCBFxNeFUXq (91.214.44.182) At 2010-08-11 15:39,
Excellent site. It was pleasant to me., http://connect.syracuse.com/user/vanessahudgenssextape/index.html Only vanessa hudgens sex tape, %(((,
#1910 by sfPgbZKpTBlq (91.214.44.182) At 2010-08-11 15:31,
Is it so important?, http://trig.com/vanessahudgenssextape/biography vanessa hudgens sex tape, %-)),
#1909 by fSvGdLZCt (91.214.44.182) At 2010-08-11 15:24,
Incredible site!, <a href= http://connect.syracuse.com/user/noeliasextape/index.html >noelia sex tape discount</a>, [url= http://connect.syracuse.com/user/noeliasextape/index.html ]noelia sex tape discount[/url], eng,
#1908 by LmehAdyGreorFoqp (91.214.44.182) At 2010-08-11 15:16,
It is a very good thing, <a href= http://trig.com/noeliasextape/biography#1 >Buy noelia sex tape</a> [url=http://trig.com/noeliasextape/biography#1]Buy noelia sex tape[/url], 416,
#1907 by KAjdSVKrPDjy (91.214.44.182) At 2010-08-11 15:09,
I like your work!, <a href= http://trig.com/keeleyhazellsextape/biography#1 >All about keeley hazell sex tape</a> [url=http://trig.com/keeleyhazellsextape/biography#1]All about keeley hazell sex tape[/url], 8OO,
#1906 by zGzryFoYLUXaYJ (91.214.44.182) At 2010-08-11 14:54,
Nice, <a href= http://connect.syracuse.com/user/lindsaylohansextape/index.html#1 >lindsay lohan sex tape discount</a> [url=http://connect.syracuse.com/user/lindsaylohansextape/index.html#1]lindsay lohan sex tape discount[/url], 8-[[,
#1905 by lmTZDcoBSo (91.214.44.182) At 2010-08-11 14:46,
Excellent site. It was pleasant to me., <a href= http://connect.syracuse.com/user/jessicasimpsonsextape/index.html#1 >Real jessica simpson sex tape</a> [url=http://connect.syracuse.com/user/jessicasimpsonsextape/index.html#1]Real jessica simpson sex tape[/url], :-]]],
#1904 by jUOKTdDdItZukMO (91.214.44.182) At 2010-08-11 14:31,
Only, <a href= http://trig.com/jessicasimpsonsextape >jessica simpson sex tape now</a>, [url= http://trig.com/jessicasimpsonsextape ]jessica simpson sex tape now[/url], 02815,
#1903 by oCzwXNkWvwR (91.214.44.182) At 2010-08-11 14:23,
Great site. Keep doing., http://connect.syracuse.com/user/pamelaandersonsextape/index.html pamela anderson sex tape here, sohgh,
#1902 by xeHMVQnTJbYsjI (91.214.44.182) At 2010-08-11 14:15,
Very interesting sites., <a href= http://trig.com/pamelaandersonsextape/biography >pamela anderson sex tape information</a>, [url= http://trig.com/pamelaandersonsextape/biography ]pamela anderson sex tape information[/url], kvmoo,
#1901 by BhbshhZeNKr (91.214.44.182) At 2010-08-11 14:08,
Incredible site!, <a href= http://connect.syracuse.com/user/carmenelectrasextape/index.html >carmen electra sex tape</a>, [url= http://connect.syracuse.com/user/carmenelectrasextape/index.html ]carmen electra sex tape[/url], hhnfh,
#1900 by PHjDjCjSDq (91.214.44.182) At 2010-08-11 13:45,
Your Site Is Great!, <a href= http://trig.com/carmenelectrasextape/biography#1 >carmen electra sex tape</a> [url=http://trig.com/carmenelectrasextape/biography#1]carmen electra sex tape[/url], pxw,
#1899 by SRGDHCsqybVy (91.214.44.182) At 2010-08-11 13:38,
I want to say thanks!, http://connect.syracuse.com/user/britneyspearssextape/index.html britney spears sex tape online, brpo,
#1898 by KQxcyvTxCqhvaJMyX (91.214.44.182) At 2010-08-11 13:30,
Best Wishes, <a href= http://trig.com/britneyspearssextape/biography >britney spears sex tape</a>, [url= http://trig.com/britneyspearssextape/biography ]britney spears sex tape[/url], >:(((,
#1897 by hFMcSgOxbgoekA (91.214.44.182) At 2010-08-11 13:23,
Best Wishes, <a href= http://connect.syracuse.com/user/celebritysextapes/index.html >Cheapest celebrity sex tapes</a>, [url= http://connect.syracuse.com/user/celebritysextapes/index.html ]Cheapest celebrity sex tapes[/url], pimkh,
#1896 by SLalDASSPkfmiVySDul (91.214.44.182) At 2010-08-11 13:15,
Best Wishes, http://trig.com/celebritysextapes/biography celebrity sex tapes here, 0516,
#1895 by RNedCukxNAJAqAkA (91.214.44.182) At 2010-08-11 13:07,
Thank you, <a href= http://connect.syracuse.com/user/carrieprejeansextape/index.html >carrie prejean sex tape online</a>, [url= http://connect.syracuse.com/user/carrieprejeansextape/index.html ]carrie prejean sex tape online[/url], %OO,
#1894 by DHDCOXprpfRRIwv (91.214.44.182) At 2010-08-11 13:00,
:-), <a href= http://trig.com/carrieprejeansextape/biography >carrie prejean sex tape discount</a>, [url= http://trig.com/carrieprejeansextape/biography ]carrie prejean sex tape discount[/url], 0542,
#1893 by iEckEaqXlGnVt (91.214.44.182) At 2010-08-11 12:52,
What?, http://trig.com/rkellysextape/biography r kelly sex tape, :-(,
#1892 by ATeLZxbSuhCryzjHR (91.214.44.182) At 2010-08-11 12:37,
Where it is possible to buy the, http://connect.syracuse.com/user/rayjsextape/index.html Cheap ray j sex tape, =-[[,
#1891 by kSAXUZnbuE (91.214.44.182) At 2010-08-11 12:29,
It is a very good thing, <a href= http://trig.com/rayjsextape/biography >ray j sex tape discount</a>, [url= http://trig.com/rayjsextape/biography ]ray j sex tape discount[/url], wgmuoq,
#1890 by VqDRsfod (91.214.44.182) At 2010-08-11 12:21,
I like your work!, <a href= http://trig.com/parishiltonsextape/biography#1 >paris hilton sex tape</a> [url=http://trig.com/parishiltonsextape/biography#1]paris hilton sex tape[/url], 01357,
#1889 by nDzXDbTmC (91.214.44.182) At 2010-08-11 12:06,
Best, <a href= http://connect.syracuse.com/user/kimkardashiansextape/index.html >kim kardashian sex tape price</a>, [url= http://connect.syracuse.com/user/kimkardashiansextape/index.html ]kim kardashian sex tape price[/url], jdkmm,
#1888 by RtiqgbUSZbDbh (91.214.44.182) At 2010-08-11 11:58,
I like your work!, <a href= http://trig.com/kimkardashiansextape/biography >Best kim kardashian sex tape</a>, [url= http://trig.com/kimkardashiansextape/biography ]Best kim kardashian sex tape[/url], 9697,
#1887 by JIeSgAVRFB (91.214.44.182) At 2010-08-11 11:50,
Incredible site!, http://www.formspring.me/personalloanfor personal loan for poor credit information, lsnlw,
#1886 by DhBUWAzd (91.214.44.182) At 2010-08-11 11:43,
Thank you, http://www.formspring.me/guaranteedonlin guaranteed online personal loans, 80915,
#1885 by ePqpiKZJouqtxNl (91.214.44.182) At 2010-08-11 11:35,
Nise site, http://www.formspring.me/studentdebtcons student debt consolidation loans for you, =]],
#1884 by TaaZvliJJbRTmXnTcH (91.214.44.182) At 2010-08-11 11:20,
Where it is possible to buy the, <a href= http://www.formspring.me/nocreditchecklo >no credit check loans</a>, [url= http://www.formspring.me/nocreditchecklo ]no credit check loans[/url], :-[,
#1883 by JaUJMBGBOWjkbla (91.214.44.182) At 2010-08-11 11:12,
What?, http://www.formspring.me/highriskpersona Best high risk personal loans, 442,
#1882 by FFqNhrOiZITDNzyX (91.214.44.182) At 2010-08-11 11:05,
Your Site Is Great!, <a href= http://www.formspring.me/nocreditcheckst#1 >Cheapest no credit check student loan</a> [url=http://www.formspring.me/nocreditcheckst#1]Cheapest no credit check student loan[/url], 8-(,
#1881 by okDJXNxbkUpLMyEpjDu (91.214.44.182) At 2010-08-11 10:57,
I have the same., http://www.formspring.me/badcreditstuden Discount bad credit student loans, >:O,
#1880 by VBoeLHSWqR (91.214.44.182) At 2010-08-11 10:49,
Where it is possible to buy the, <a href= http://www.formspring.me/buyhydrocodones >buy hydrocodone</a>, [url= http://www.formspring.me/buyhydrocodones ]buy hydrocodone[/url], =))),
#1879 by WBTAxXyQatTclTfP (91.214.44.182) At 2010-08-11 10:42,
Is it so important?, http://www.formspring.me/buysomanowsh buy soma here, 943,
#1878 by oYBLInexOzdWASannT (91.214.44.182) At 2010-08-11 10:35,
Where it is possible to buy the, <a href= http://www.formspring.me/buylevitra#1 >buy levitra price</a> [url=http://www.formspring.me/buylevitra#1]buy levitra price[/url], =-]]],
#1877 by VSDAiXgHimozdqszRDe (91.214.44.182) At 2010-08-11 10:27,
I like your work!, <a href= http://www.formspring.me/buycialisnow >Real buy cialis</a>, [url= http://www.formspring.me/buycialisnow ]Real buy cialis[/url], =DDD,
#1876 by LusuvdNsiUPcjXTub (91.214.44.182) At 2010-08-11 10:20,
I like it so much, <a href= http://www.formspring.me/buyadipex >Cheapest buy adipex</a>, [url= http://www.formspring.me/buyadipex ]Cheapest buy adipex[/url], ucvsb,
#1875 by ApAcQwickrfhDVXLqa (91.214.44.182) At 2010-08-11 10:12,
Real, <a href= http://connect.syracuse.com/user/taxrecordscopakenewyork/index.html >tax records copake new york</a>, [url= http://connect.syracuse.com/user/taxrecordscopakenewyork/index.html ]tax records copake new york[/url], %-O,
#1874 by MGWwchpnRXegKqLtJvs (91.214.44.182) At 2010-08-11 10:04,
So where it to find, <a href= http://www.formspring.me/buytramadolnow >buy tramadol free</a>, [url= http://www.formspring.me/buytramadolnow ]buy tramadol free[/url], lofyy,
#1873 by QqhBrAaEBOPgLZDwXWx (91.214.44.182) At 2010-08-11 09:57,
Excellent site. It was pleasant to me., <a href= http://connect.syracuse.com/user/arthritistreatments/index.html >arthritis treatments discount</a>, [url= http://connect.syracuse.com/user/arthritistreatments/index.html ]arthritis treatments discount[/url], 1882,
#1872 by IUirpuPlQE (91.214.44.182) At 2010-08-11 09:49,
I have the same., http://www.formspring.me/buyxanax buy xanax, %-OOO,
#1871 by XJgjXEyx (91.214.44.182) At 2010-08-11 09:41,
:-(, http://connect.syracuse.com/user/freemusicalecards/index.html Only free musical ecards, 119610,
#1870 by HgfOuOiGrBv (91.214.44.182) At 2010-08-11 09:34,
Beautiful site, <a href= http://www.formspring.me/buyviagrahere >buy viagra</a>, [url= http://www.formspring.me/buyviagrahere ]buy viagra[/url], 57095,
#1869 by PIUeFxcqBSoSnKuUKG (91.214.44.182) At 2010-08-11 09:26,
What?, <a href= http://www.formspring.me/diflucan#1 >diflucan</a> [url=http://www.formspring.me/diflucan#1]diflucan[/url], 8]]],
#1868 by XtuwundDfbKSpCtoHir (91.214.44.182) At 2010-08-11 09:11,
Great site. Keep doing., http://connect.syracuse.com/user/downloadlimewireprofree/index.html download limewire pro free, =-PPP,
#1867 by DiopLZYtJnmu (91.214.44.182) At 2010-08-11 09:04,