看了一篇关于j2ee for freebsd的文章
有点过时,不过因为找资料也给他稍微翻译了下下 嘿嘿.
原文部分---
**********************************************
Ensure that you have the current ports collection as make it will fail if it attempts to build older source. You can upgrade your entire ports collection by using CVSup. See Using CVSup section of the Handbook for more information. You can also download the ports you need manually from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ to get you going.
Note: You will need the Linux Emulation (Linux-ABI) enabled in your kernel configuration. Simply add the following option to your kernel configuration file and recompile it. Instructions for building a kernel can be found in the FreeBSD Handbook.
options COMPAT_LINUX
The above option will add Linux-ABI support to your kernel, when it is recompiled.
The list of dependencies below, are required to be installed manually in a certain order. Dependencies that are automatically downloaded are not listed here.
java/jdk13
java/linux-jdk13
You will need to get the following:
Download bsd-jdk131-patches-9.tar.gz from http://www.eyesbeyond.com/freebsddom/java/jdk13.html and place it under /usr/ports/distfiles.
Next get out your web browser and head on over to http://java.sun.com/j2se/1.3/download-linux.html and find SDK downloads. Click on the ``continue'' button below ``GNUZIP Tar Shell Script''. Be sure you read every word of the license page before you click on the ``Accept'' button! You will be brought to a page titled ``Download Java(TM) 2 SDK, Standard Edition 1.3.1_10''. Scroll to the bottom and click on the ``HTTP download'' button. When the ``File Download'' box comes up, be sure to click on the ``Open'' button rather than the ``Save'' button. You will be presented with another ``File Download'' box - this time choose ``Save'' and you will be able to save j2sdk-1_3_1_10-linux-i386.bin. Place it in /usr/ports/distfiles.
Go to http://www.sun.com/software/java2/download.html. In the table under Produce Description, named Java 2 SDK 1.3.1, go to the right-hand cell and click ``download''. You will be taken to the ``Sign On'' page, where you must sign in if you already have an account, or register for access. Once you have signed on, you will be taken to the ``Legal'' page, where you must accept the license agreement; scroll down (reading the license) and click on the ``Continue'' button. Next page, is the ``Receipt'' page. This is where you will save your order number. You will be able to choose the location that is nearest to you. Click on ``Java 2 SDK, Standard Edition, version 1.3.1''. Save the j2sdk-1_3_1-src.tar.gz to the /usr/ports/distfiles/ directory.
Note: It is very important for you to read the License Agreement which has been issued by Sun Microsystems Corp. There are several restrictions in place on the use of Java, which you must address. The FreeBSD Project does not take any responsibilities for your actions.
Do not discard any of the downloaded files, as they will be needed for building some of the native ports for FreeBSD, which are discussed later on.
Now that you have assembled all the source files and ports, you need to start by building java/linux-jdk13:
# cd /usr/ports/java/linux-jdk13
# make all install clean
Once you have built java/linux-jdk13, you need to test it, to make sure it works as intended. To do that:
# cd /usr/local/linux-jdk1.3.1/bin
# ./java -version
The output of the above command should be as follows:
java version "1.3.1_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_10-b02)
Classic VM (build 1.3.1_02-b02, green threads, nojit)
If you did not get the correct response, you need to:
# cd /usr/ports/java/linux-jdk13
# make deinstall
And make sure that /usr/local does not contain a linux-jdk1.3.1 directory. If you find a fragment of the directory, delete it. Repeat the build and install process for java/linux-jdk13.
To make the native Java Development Kit 1.3.1 for FreeBSD, do the following:
Make sure you have the j2sdk-1_3_1-src.tar.gz file in your /usr/ports/distfiles. This file is needed for applying the ``patch-set'' discussed below.
You will need to download the patch set for building the port. The patch-set file is called bsd-jdk131-patches-9.tar.gz. You should also make sure the integrity of the files by matching it with the following MD5 checksum.
MD5 (bsd-jdk131-patches-9.tar.gz) = 29c83880d3555abcf74fc7df9db1959f
The patch-set is available from: http://www.eyesbeyond.com/freebsddom/java/index.html
The last procedure discussed above (building the native JDK) will take some time.
******************************************************************************
翻译后的文章(有比较多的也是根据自己的意愿翻译)
-----------------------------------------------------------------------------------------------------------------------------------------
确定你有当前ports的收集,如果你试图去建立旧的资源
去make 将会失败。你可以使用CVSup更新你的整个
prots.查看帮助手册的使用CVSup部分获得更多的帮助,
当然你也可以从
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ 手动下载
你需要的ports
注意:你将需要在内核配置中linux 模仿是可用的,你
也可以简单的在你的内核配置文件中增加下面的选项并
且从新编译,编译内核方法的介绍你可以查阅 freebsd
帮助手册.
options COMPAI_LINUX
上面的选项将增加Linux_ABI支持到你的内核,当你重新
编译后.
依存下面的清单在可以执行的命令下手动安装,当然
自动可以下载的安装清单不在该列.
java/jdk13
java/linux-jdk13
你将需要获取以下的程序
1.从
http://www.eyesbeyond.com/freebsddom/java/jdk13.h
tml 下载bsd-jdk131-patches-9.tar.gz 并且放在
/usr/ports/distfiles/目录下
2.打开浏览器进去
http://java.sun.com/j2se/1.3/download-linux.html
找到SDK下载,点击"GNUZIP Tar Shell Script''下面的
"Continue"按钮,在你点击"accept"按钮前 你确定已经
完整的阅读完了许可页面.你将被带到"Download
Java(TM) 2 SDK, Standard Edition 1.3.1_10" 滚动按
钮并且点击"HTTP download" 当"File Download"按钮出
来后确定 点击"保存" 保存
j2sdk-1_3_1_10-linux-i386.bin在
/usr/ports/distfiles下.
打开
http://www.sun.com/software/java2/download.html
在Produce Description下面的表格里 有一个Jva 2SDK
1.3.1 在右边的手形表格里点击"download" 这样就会跳
转到 "Sign On" 页面,在这里你必须要输入你的登陆验
证 或者先注册一个帐号然后登陆,如果你已经登陆了,你
将会看到"Legal"页面,在这里你必须接受许可协议, 读
完许可点"continue"按钮继续,下一页将是"RECEIPT"页
面,在这里你可以保存你的定购数量,你也可以选择离你
最近的下载站点下载,点"Java 2 SDK, Standard
Edition, version 1.3.1" 保存j2sdk-1——3——
1-src.tar.gz到 /usr/ports/distfiles/ 文件夹下.
注意:
你很有必要看一下Sun Mircrosystems公司的 许可协
议....
现在你已经获得了安装需要的所有源代码和ports
你可以开始配置java/linux-jdk13:
cd /usr/ports/java/linux-jdk13
make all install clean
一旦你配置了java/linux-jdk13 你应该测试一下看是否
正常工作了:
cd /usr/local/linux-jdk1.3.1/bin
./java -version
输出的信息如下:
java version "1.3.1_10"
Java(TM) 2 Runtime Environment, Standard Edition
(build 1.3.1_10-b02)
Classic VM (build 1.3.1_02-b02, green threads,
nojit)
如果没有得到上面的信息你需要卸载重新安装
cd /usr/ports/java/linux-jdk13
make deinstall
并且确定 在/usr/local 下没有linux-jdk1.3.1文件夹
如果你发现这个文件夹存在 删除掉 重新开始配置和安
装 /java/linux-jdk13.
在freebsd上编译安装 java Development Kit 1.3.1 使
用下面的方法:
1.确定 /usr/ports/distfiles目录下有
j2sdk-1_3_1-src.tar.gz文件 这个文件在下面将会对其
补丁设置
2.为了配置port 你也需要下载补丁配置 called
bsd-jdk131-patches-9.tar.gz 你也要核对MD5来检验文
件的完整性.
MD5(bsd-jdk131-patches-9.tar.gz) =
29c83880d3555abcf74fc7df9db1959f
补丁配置可以查看
http://www.eyesbeyond.com/freebsddom/java/index.h
tml.