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


#1966 by (23.94.2.17|23.94.2.17) At 2015-04-13 16:25,
Beautiful site, <a href= http://cre.ations.net/creator/kimkardashiansextape >kim kardashian sex tape free</a>, [url= http://cre.ations.net/creator/kimkardashiansextape ]kim kardashian sex tape free[/url], 8129,
#1965 by rmFLiIAdoRSF (79.142.65.175) At 2010-08-31 00:01,
Incredible site!, <a href= http://trig.com/buyhydrocodone/biography >buy hydrocodone</a>, [url= http://trig.com/buyhydrocodone/biography ]buy hydrocodone[/url], 08312,
#1964 by eKOitTVbNDwbvEYJyV (91.214.44.182) At 2010-08-11 23:34,
Best Wishes, <a href= http://trig.com/buysoma/biography >Discount buy soma</a>, [url= http://trig.com/buysoma/biography ]Discount buy soma[/url], >:]]],
#1963 by hdeQqdOoecwocAIj (91.214.44.182) At 2010-08-11 23:27,
Best Wishes, http://connect.syracuse.com/user/personalloanforpoorcredit/index.html personal loan for poor credit, sujv,
#1962 by MGgsyTkepRbpsEbqYfU (91.214.44.182) At 2010-08-11 23:19,
Nice, <a href= http://trig.com/buylevitra/biography >buy levitra</a>, [url= http://trig.com/buylevitra/biography ]buy levitra[/url], 01888,
#1961 by nlpFfyEyf (91.214.44.182) At 2010-08-11 23:12,
I want to say thanks!, <a href= http://connect.syracuse.com/user/guaranteedonlinepersonalloans/index.html#1 >Best guaranteed online personal loans</a> [url=http://connect.syracuse.com/user/guaranteedonlinepersonalloans/index.html#1]Best guaranteed online personal loans[/url], 82939,
#1960 by jvRjoUyp (91.214.44.182) At 2010-08-11 23:05,
Best Wishes, http://trig.com/buycialises/biography buy cialis, ijwj,
#1959 by kGEibakCuhJNeWyp (91.214.44.182) At 2010-08-11 22:57,
Very interesting sites., <a href= http://connect.syracuse.com/user/need5000loanovernight/index.html >need 5000 loan overnight</a>, [url= http://connect.syracuse.com/user/need5000loanovernight/index.html ]need 5000 loan overnight[/url], 359182,
#1958 by KbkQhxWHzKDhRglQc (91.214.44.182) At 2010-08-11 22:50,
Very interesting sites., <a href= http://connect.syracuse.com/user/studentdebtconsolidationloans/index.html >student debt consolidation loans price</a>, [url= http://connect.syracuse.com/user/studentdebtconsolidationloans/index.html ]student debt consolidation loans price[/url], 8779,
#1957 by bJLjCMsEwSV (91.214.44.182) At 2010-08-11 22:35,
Great, <a href= http://trig.com/buytramadol/biography >Cheap buy tramadol</a>, [url= http://trig.com/buytramadol/biography ]Cheap buy tramadol[/url], 222,
#1956 by MpnPFDNmEjBYhIIeEu (91.214.44.182) At 2010-08-11 22:27,
Beautiful site, <a href= http://connect.syracuse.com/user/nocreditcheckloans/index.html#1 >no credit check loans</a> [url=http://connect.syracuse.com/user/nocreditcheckloans/index.html#1]no credit check loans[/url], gsu,
#1955 by YFoOzttJA (91.214.44.182) At 2010-08-11 22:19,
It is a very good thing, http://connect.syracuse.com/user/highriskpersonalloans/index.html high risk personal loans, :-),
#1954 by swWqqVRHnUcqFU (91.214.44.182) At 2010-08-11 22:04,
Great, <a href= http://connect.syracuse.com/user/badcreditstudentloans/index.html#1 >Only bad credit student loans</a> [url=http://connect.syracuse.com/user/badcreditstudentloans/index.html#1]Only bad credit student loans[/url], =-(,
#1953 by hUrKXGdXzPTtddy (91.214.44.182) At 2010-08-11 21:49,
What is it, <a href= http://trig.com/diflucan/biography#1 >diflucan</a> [url=http://trig.com/diflucan/biography#1]diflucan[/url], gal,
#1952 by peQYxEOr (91.214.44.182) At 2010-08-11 21:41,
Very interesting sites., http://connect.syracuse.com/user/buyhydrocodone/index.html buy hydrocodone, >:-))),
#1951 by vwGynaxFIWY (91.214.44.182) At 2010-08-11 21:34,
I have the same., <a href= http://trig.com/diovan/biography#1 >diovan</a> [url=http://trig.com/diovan/biography#1]diovan[/url], 4339,
#1950 by vfnKxmDVJnDqZ (91.214.44.182) At 2010-08-11 21:26,
It is a very good thing, <a href= http://trig.com/percocet/biography#1 >percocet</a> [url=http://trig.com/percocet/biography#1]percocet[/url], >:-(,
#1949 by mdDgqfGOo (91.214.44.182) At 2010-08-11 21:11,
Incredible site!, http://connect.syracuse.com/user/buylevitras/index.html buy levitra, iisxsq,
#1948 by vhsoEVEGGYTRKIbYvw (91.214.44.182) At 2010-08-11 21:04,
Beautiful site, <a href= http://trig.com/darvocet/biography >darvocet online</a>, [url= http://trig.com/darvocet/biography ]darvocet online[/url], 504,
#1947 by ojJkoMMz (91.214.44.182) At 2010-08-11 20:56,
Give somebody the to a site about the, <a href= http://connect.syracuse.com/user/buycialises/index.html >Cheap buy cialis</a>, [url= http://connect.syracuse.com/user/buycialises/index.html ]Cheap buy cialis[/url], ushk,
#1946 by jyjtdESlQDCpQJ (91.214.44.182) At 2010-08-11 20:49,
Great site. Keep doing., <a href= http://trig.com/aricept/biography >Best aricept</a>, [url= http://trig.com/aricept/biography ]Best aricept[/url], tbex,
#1945 by UYUOgANsHtdhfJNw (91.214.44.182) At 2010-08-11 20:41,
Your Site Is Great!, <a href= http://connect.syracuse.com/user/buyadipexs/index.html >buy adipex</a>, [url= http://connect.syracuse.com/user/buyadipexs/index.html ]buy adipex[/url], 0796,
#1944 by TXRTnZhWaqhXYRh (91.214.44.182) At 2010-08-11 20:34,
So where it to find, <a href= http://trig.com/bactrims/biography >bactrim</a>, [url= http://trig.com/bactrims/biography ]bactrim[/url], =-),
#1943 by tejEiuCnMQiO (91.214.44.182) At 2010-08-11 20:26,
What?, <a href= http://trig.com/mortgageratespredictions/biography >All about mortgage rates predictions</a>, [url= http://trig.com/mortgageratespredictions/biography ]All about mortgage rates predictions[/url], 697800,
#1942 by OQflrzibzj (91.214.44.182) At 2010-08-11 20:11,
Best Wishes, <a href= http://connect.syracuse.com/user/buyxanaxs/index.html#1 >buy xanax information</a> [url=http://connect.syracuse.com/user/buyxanaxs/index.html#1]buy xanax information[/url], fizyj,
#1941 by KJEEEcxWORVaDcq (91.214.44.182) At 2010-08-11 20:03,
It is a very good thing, <a href= http://trig.com/guaranteedonlinepersonalloans/biography >All about guaranteed online personal loans</a>, [url= http://trig.com/guaranteedonlinepersonalloans/biography ]All about guaranteed online personal loans[/url], 970260,
#1940 by NAytgHkVsodshmzcQC (91.214.44.182) At 2010-08-11 19:41,
So where it to find, http://connect.syracuse.com/user/diflucans/index.html diflucan price, 8DD,
#1939 by yyspWJLAZylBGvTnKq (91.214.44.182) At 2010-08-11 19:33,
Nise site, <a href= http://trig.com/need5000loanovernight/biography#1 >need 5000 loan overnight here</a> [url=http://trig.com/need5000loanovernight/biography#1]need 5000 loan overnight here[/url], zhlodz,
#1938 by DDtOSewPgmIqdGHo (91.214.44.182) At 2010-08-11 19:25,
Great site. Keep doing., <a href= http://connect.syracuse.com/user/diovans/index.html#1 >Buy diovan</a> [url=http://connect.syracuse.com/user/diovans/index.html#1]Buy diovan[/url], 3126,
#1937 by FikNkTGDRlaz (91.214.44.182) At 2010-08-11 19:18,
Great, <a href= http://trig.com/studentdebtconsolidationloans/biography >Real student debt consolidation loans</a>, [url= http://trig.com/studentdebtconsolidationloans/biography ]Real student debt consolidation loans[/url], 4004,
#1936 by oIhcvtGGC (91.214.44.182) At 2010-08-11 19:11,
Help me to find the, <a href= http://connect.syracuse.com/user/percocets/index.html#1 >percocet</a> [url=http://connect.syracuse.com/user/percocets/index.html#1]percocet[/url], hgox,
#1935 by JJLEGFpTtQz (91.214.44.182) At 2010-08-11 19:03,
best for you, <a href= http://trig.com/nocreditcheckloans/biography#1 >All about no credit check loans</a> [url=http://trig.com/nocreditcheckloans/biography#1]All about no credit check loans[/url], :-((,
#1934 by zmMJHvizQAJ (91.214.44.182) At 2010-08-11 18:55,
Beautiful site, http://connect.syracuse.com/user/darvocet/index.html darvocet free, >:),
#1933 by DowELcSA (91.214.44.182) At 2010-08-11 18:48,
Give somebody the to a site about the, http://trig.com/highriskpersonalloans/biography high risk personal loans, >:),
#1932 by itzcvnwlMvJECpeBTyZ (91.214.44.182) At 2010-08-11 18:40,
It is a very good thing, http://connect.syracuse.com/user/aricept/index.html aricept, fjlp,
#1931 by LtkJRnXzm (91.214.44.182) At 2010-08-11 18:33,
What?, http://trig.com/nocreditcheckstudentloan/biography no credit check student loan discount, =-[,
#1930 by ALzgptDI (91.214.44.182) At 2010-08-11 18:25,
Is it so important?, http://connect.syracuse.com/user/bactrim/index.html bactrim, 526,
#1929 by GuHBnTAvmWoHOFr (91.214.44.182) At 2010-08-11 18:18,
:-(, http://trig.com/badcreditstudentloans/biography Cheap bad credit student loans, =PP,
#1928 by nZmZNFgeLxtLyk (91.214.44.182) At 2010-08-11 18:09,
Thank you, http://connect.syracuse.com/user/bbwsex/index.html bbw sex, 8-OO,
#1927 by OFBZXwQxmmMmUsvw (91.214.44.182) At 2010-08-11 18:02,
So where it to find?, <a href= http://trig.com/bbwsex/biography#1 >bbw sex discount</a> [url=http://trig.com/bbwsex/biography#1]bbw sex discount[/url], 76119,
#1926 by aXRlwFpQXKtTbOEGmMQ (91.214.44.182) At 2010-08-11 17:55,
Only, <a href= http://connect.syracuse.com/user/shemalesex/index.html >shemale sex</a>, [url= http://connect.syracuse.com/user/shemalesex/index.html ]shemale sex[/url], hmmoi,
#1925 by IRsjEHVoWeDsole (91.214.44.182) At 2010-08-11 17:47,
Beautiful site, http://trig.com/shemalesex/biography shemale sex, 381664,
#1924 by kwBpFLNFJ (91.214.44.182) At 2010-08-11 17:40,
Hi, <a href= http://connect.syracuse.com/user/interracialsex/index.html#1 >Cheap interracial sex</a> [url=http://connect.syracuse.com/user/interracialsex/index.html#1]Cheap interracial sex[/url], xra,
#1923 by cNDwwSaVf (91.214.44.182) At 2010-08-11 17:32,
Your Site Is Great, http://trig.com/interracialsex/biography interracial sex price, eiovze,
#1922 by WJBhscgim (91.214.44.182) At 2010-08-11 17:25,
Great, <a href= http://connect.syracuse.com/user/grannysex/index.html#1 >granny sex online</a> [url=http://connect.syracuse.com/user/grannysex/index.html#1]granny sex online[/url], ppwj,
#1921 by wlpLLyslGsDWfGbOQ (91.214.44.182) At 2010-08-11 17:18,
Excellent site. It was pleasant to me., <a href= http://trig.com/grannysex/biography#1 >granny sex price</a> [url=http://trig.com/grannysex/biography#1]granny sex price[/url], 520126,
#1920 by vKKIFLgFfYB (91.214.44.182) At 2010-08-11 17:10,
Incredible site!, http://connect.syracuse.com/user/webcamsex/index.html Only web cam sex, =OOO,
#1919 by OOmiiTUqpsn (91.214.44.182) At 2010-08-11 17:03,
:-(, http://trig.com/amyfishersextape/biography amy fisher sex tape, >:PP,
#1918 by ZIiiFCITVFqHdI (91.214.44.182) At 2010-08-11 16:40,
Good Job, http://connect.syracuse.com/user/jenniriverasextape/index.html All about jenni rivera sex tape, %O,
#1917 by niyIcRzhUBIFX (91.214.44.182) At 2010-08-11 16:32,