Oct 21, 2002 onlsbc1: Red Hat Linux 7.3システムにJavaをインストール --- Javaインストール #1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/para-CAMAC/ Work/SBC-Java1.html) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 目的 並列CAMACで使用するSBC上のLinuxシステムでは、Javaが利用できる必要が ある。 理由は、並列CAMACでは複数のCAMACコントローラ中のSBCとこれら のCAMACコントローラからデータを集めるDAQコントロールマシンとの間で 分散オブジェクトシステムを構築することを想定しているからである。 JavaRMI、JavaIDL さらにはHORBなどが実行できる基本的なものとして Javaをインストールする。 (1). Java v1.4.1 の入手 (2). Javaのインストール (3). 設定 -------------------------------------------------------------------- (1). Java v1.4.1 の入手 J2SE v1.4.1 のダウンロードサイトから、"SDK Linux 自己解凍ファイル" を 入手する。 URL: http://java.sun.com/j2se/1.4.1/ja/download.html ファイル名: j2sdk-1_4_1-linux-i586.binファイル (1-1). システム要件のチェック 要件 1. "このバージョンの J2SDK (J2SDK) は、Linux カーネル v 2.2.12 および glibc v2.1.2-11 以降が動作する Intel Pentium プラットフォームでサポート されます。" [inoue@onlsbc1 inoue]$ ls /lib/libc-* /lib/libc-2.2.5.so [inoue@onlsbc1 inoue]$ ok. 要件を満足している。 要件 2. "J2SDK ソフトウェアをインストールするには、75M バイトの空きディスク容量 が必要です。" [inoue@onlsbc1 inoue]$ df -k Filesystem 1k-blocks Used Available Use% Mounted on /dev/hdc1 483886 276278 182612 61% / none 152332 0 152332 0% /dev/shm [inoue@onlsbc1 inoue]$ pwd /home/inoue [inoue@onlsbc1 inoue]$ ls -l 合計 1 drwxrwxr-x 2 inoue inoue 1024 10月 18 17:12 Java [inoue@onlsbc1 inoue]$ ls -l Java 合計 41290 -rw-r--r-- 1 inoue inoue 42114758 10月 18 15:47 j2sdk-1_4_1-linux-i586. bin [inoue@onlsbc1 inoue]$ ok. 要件を満足している。 要件 3. "英語ロケールでの J2SDK 1.4.1 Linux 版のほとんどのテストは、Red Hat 7.2 上で、カーネルパッチ 2.4.9-31 を使用して行われています。英語以外のロケー ルでのほとんどのテストは、Red Hat 7.1 上で行われています。ただし、以下の Linux オペレーティングシステムに対しては、J2SDK 1.4.1 のテストは限られた ものしか行われていません。 Caldera Open Linux 3.1 (kernel 2.4.2, glibc 2.2.1) Turbo Linux 7.0 (kernel 2.2.18, glivc 2.1.x) Suse Linux 7.1 (kernel 2.4, glibc 2.2.14) Turbo Linux (簡体字中国語ロケール版) " SBC上のLinuxシステムでは、Red Hat 7.3 を使用している。 カーネルのバー ジョンは2.4.18-3である。 したがって、この要件は満足しているとしてよい。 (1-2). 既知の問題 "RedHat Linux 7 サーバ を使用する場合、Java HotSpot VM の使用時に「error while loading shared libraries」というエラーが発生するのを防ぐために、 compat-libstdc++-6.21-2.9.0.0.i386.rpm を手動でインストールする必要が あります。" onlsun4[35]% pwd /space2/RedHat7.3/disk2/RedHat/RPMS onlsun4[36]% ls comp* compat-egcs-6.2-1.1.2.16.i386.rpm compat-egcs-c++-6.2-1.1.2.16.i386.rpm compat-egcs-g77-6.2-1.1.2.16.i386.rpm compat-egcs-objc-6.2-1.1.2.16.i386.rpm compat-glibc-6.2-2.1.3.2.i386.rpm compat-libs-6.2-3.i386.rpm compat-libstdc++-6.2-2.9.0.16.i386.rpm onlsun4[37]% [inoue@onlsbc1 inoue]$ rpm -q compat-libstdc++-6.2-2.9.0.16 パッケージ compat-libstdc++-6.2-2.9.0.16 はインストールされていません [inoue@onlsbc1 inoue]$ SBC上のLinuxシステムでは、Red Hat 7.3 サーバ を使用している。 さらに、 上記の "既知の問題" で関連するパッケージのインストールもやっていない。 この件については、障害がおきた時に対応することにする。 (2). Javaのインストール (2-1). ダウンロードしたファイルのサイズを確認 Download j2sdk-1_4_1-linux-i586.bin . Filesize = 42,114,758 bytes. [inoue@onlsbc1 Java]$ ls -l 合計 41290 -rw-r--r-- 1 inoue inoue 42114758 10月 18 15:47 j2sdk-1_4_1-linux-i586. bin [inoue@onlsbc1 Java]$ ok. ファイルサイズはコピー元のものと一致している。 (2-2). インストール先ディレクトリへ j2sdk-1_4_1-linux-i586.bin をコピー [root@onlsbc1 usr]# pwd /usr [root@onlsbc1 usr]# ls X11R6 dict games kerberos libexec sbin src bin etc include lib local share tmp [root@onlsbc1 usr]# mv /home/inoue/Java/j2sdk-1_4_1-linux-i586.bin . [root@onlsbc1 usr]# ls X11R6 dict games j2sdk-1_4_1-linux-i586.bin lib local share tmp bin etc include kerberos libexec sbin src [root@onlsbc1 usr]# (2-3). j2sdk-1_4_1-linux-i586.bin を実行 [root@onlsbc1 usr]# pwd /usr [root@onlsbc1 usr]# ls -l j2sdk-1_4_1-linux-i586.bin -rw-r--r-- 1 inoue inoue 42114758 10月 18 15:47 j2sdk-1_4_1-linux-i586. bin [root@onlsbc1 usr]# chmod a+x j2sdk-1_4_1-linux-i586.bin [root@onlsbc1 usr]# ls -l j2sdk-1_4_1-linux-i586.bin -rwxr-xr-x 1 inoue inoue 42114758 10月 18 15:47 j2sdk-1_4_1-linux-i586. bin [root@onlsbc1 usr]# ./j2sdk-1_4_1-linux-i586.bin Sun Microsystems, Inc. Binary Code License Agreement READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. 1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by Sun (collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid. 2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by Sun and/or its licensors. Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. Licensee acknowledges that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Sun Microsystems, Inc. disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Sun or its licensors is granted under this Agreement. 3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90) days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished (if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. 4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. 5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. 6. Termination. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Sun if you fail to comply with any provision of this Agreement. Upon Termination, you must destroy all copies of Software. 7. Export Regulations. All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export, re-export, or import as may be required after delivery to you. 8. U.S. Government Restricted Rights. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement; this is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD acquisitions). 9. Governing Law. Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply. 10. Severability. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. 11. Integration. This Agreement is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. JAVATM 2 SOFTWARE DEVELOPMENT KIT (J2SDK), STANDARD EDITION, VERSION 1.4.1_X SUPPLEMENTAL LICENSE TERMS These supplemental license terms ("Supplemental Terms") add to or modify the terms of the Binary Code License Agreement (collectively, the "Agreement"). Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Agreement, or in any license contained within the Software. 1. Software Internal Use and Development License Grant. Subject to the terms and conditions of this Agreement, including, but not limited to Section 4 (Java Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce internally and use internally the binary form of the Software complete and unmodified for the sole purpose of designing, developing and testing your Java applets and applications intended to run on the Java platform ("Programs"). 2. License to Distribute Software. Subject to the terms and conditions of this Agreement, including, but not limited to Section 4 (Java Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified (unless otherwise specified in the applicable README file) and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software (unless otherwise specified in the applicable README file), (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that protects Sun's interests consistent with the terms contained in this Agreement, and (vi) you agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. (vi) include the following statement as part of product documentation (whether hard copy or electronic), as a part of a copyright page or proprietary rights notice page, in an "About" box or in any other form reasonably designed to make the statement visible to users of the Software: "This product includes code licensed from RSA Security, Inc.", and (vii) include the statement, "Some portions licensed from IBM are available at http://oss.software.ibm.com/icu4j/". 3. License to Distribute Redistributables. Subject to the terms and conditions of this Agreement, including but not limited to Section 4 (Java Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute those files specifically identified as redistributable in the Software "README" file ("Redistributables") provided that: (i) you distribute the Redistributables complete and unmodified (unless otherwise specified in the applicable README file), and only bundled as part of Programs, (ii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README file), (iii) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, (iv) you only distribute the Redistributables pursuant to a license agreement that protects Sun's interests consistent with the terms contained in the Agreement, (v) you agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software, (vi) include the following statement as part of product documentation (whether hard copy or electronic), as a part of a copyright page or proprietary rights notice page, in an "About" box or in any other form reasonably designed to make the statement visible to users of the Software: "This product includes code licensed from RSA Security, Inc.", and (vii) include the statement, "Some portions licensed from IBM are available at http://oss.software.ibm.com/icu4j/". 4. Java Technology Restrictions. You may not modify the Java Platform Interface ("JPI", identified as classes contained within the "java" package or any subpackages of the "java" package), by creating additional classes within the JPI or otherwise causing the addition to or modification of the classes in the JPI. In the event that you create an additional class and associated API(s) which (i) extends the functionality of the Java platform, and (ii) is exposed to third party software developers for the purpose of developing additional software which invokes such additional API, you must promptly publish broadly an accurate specification for such API for free use by all developers. You may not create, or authorize your licensees to create, additional classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation. 5. Notice of Automatic Software Updates from Sun. You acknowledge that the Software may automatically download, install, and execute applets, applications, software extensions, and updated versions of the Software from Sun ("Software Updates"), which may require you to accept updated terms and conditions for installation. If additional terms and conditions are not presented on installation, the Software Updates will be considered part of the Software and subject to the terms and conditions of the Agreement. 6. Notice of Automatic Downloads. You acknowledge that, by your use of the Software and/or by requesting services that require use of the Software, the Software may automatically download, install, and execute software applications from sources other than Sun ("Other Software"). Sun makes no representations of a relationship of any kind to licensors of Other Software. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE OTHER SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. Distribution by Publishers. This section pertains to your distribution of the Software with your printed book or magazine (as those terms are commonly used in the industry) relating to Java technology ("Publication"). Subject to and conditioned upon your compliance with the restrictions and obligations contained in the Agreement, in addition to the license granted in Paragraph 1 above, Sun hereby grants to you a non-exclusive, nontransferable limited right to reproduce complete and unmodified copies of the Software on electronic media (the "Media") for the sole purpose of inclusion and distribution with your Publication(s), subject to the following terms: (i) You may not distribute the Software on a stand-alone basis; it must be distributed with your Publication(s); (ii) You are responsible for downloading the Software from the applicable Sun web site; (iii) You must refer to the Software as JavaTM 2 Software Development Kit, Standard Edition, Version 1.4.0; (iv) The Software must be reproduced in its entirety and without any modification whatsoever (including, without limitation, the Binary Code License and Supplemental License Terms accompanying the Software and proprietary rights notices contained in the Software); (v) The Media label shall include the following information: Copyright 2002, Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Solaris, Java, the Java Coffee Cup logo, J2SE , and all trademarks and logos based on Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This information must be placed on the Media label in such a manner as to only apply to the Sun Software; (vi) You must clearly identify the Software as Sun's product on the Media holder or Media label, and you may not state or imply that Sun is responsible for any third-party software contained on the Media; (vii) You may not include any third party software on the Media which is intended to be a replacement or substitute for the Software; (viii) You shall indemnify Sun for all damages arising from your failure to comply with the requirements of this Agreement. In addition, you shall defend, at your expense, any and all claims brought against Sun by third parties, and shall pay all damages awarded by a court of competent jurisdiction, or such settlement amount negotiated by you, arising out of or in connection with your use, reproduction or distribution of the Software and/or the Publication. Your obligation to provide indemnification under this section shall arise provided that Sun: (i) provides you prompt notice of the claim; (ii) gives you sole control of the defense and settlement of the claim; (iii) provides you, at your expense, with all available information, assistance and authority to defend; and (iv) has not compromised or settled such claim without your prior written consent; and (ix) You shall provide Sun with a written notice for each Publication; such notice shall include the following information: (1) title of Publication, (2) author(s), (3) date of Publication, and (4) ISBN or ISSN numbers. Such notice shall be sent to Sun Microsystems, Inc., 4150 Network Circle, M/S USCA12-110, Santa Clara, California 95054, U.S.A , Attention: Contracts Administration. 8. Trademarks and Logos. You acknowledge and agree as between you and Sun that Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET-related trademarks, service marks, logos and other brand designations ("Sun Marks"), and you agree to comply with the Sun Trademark and Logo Usage Requirements currently located at http://www.sun.com/policies/trademarks. Any use you make of the Sun Marks inures to Sun's benefit. 9. Source Code. Software may contain source code that is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. 10. Termination for Infringement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A (LFI#111374/Form ID#011801) Do you agree to the above license terms? [yes or no] yes Unpacking... Checksumming... : : Done. [root@onlsbc1 usr]# [root@onlsbc1 usr]# ls X11R6 dict games j2sdk-1_4_1-linux-i586.bin kerberos libexec sbin src bin etc include j2sdk1.4.1 lib local share tmp [root@onlsbc1 usr]# rm j2sdk-1_4_1-linux-i586.bin rm: remove `j2sdk-1_4_1-linux-i586.bin'? y [root@onlsbc1 usr]# ln -s j2sdk1.4.1 java [root@onlsbc1 usr]# ls -l 合計 28 drwxr-xr-x 7 root root 1024 10月 17 23:10 X11R6 drwxr-xr-x 2 root root 7168 10月 17 23:30 bin drwxr-xr-x 2 root root 1024 2月 7 1996 dict drwxr-xr-x 2 root root 1024 2月 7 1996 etc drwxr-xr-x 2 root root 1024 2月 7 1996 games drwxr-xr-x 29 root root 3072 10月 17 23:30 include drwxr-xr-x 9 root root 1024 10月 21 14:29 j2sdk1.4.1 lrwxrwxrwx 1 root root 10 10月 21 14:31 java -> j2sdk1.4.1 drwxr-xr-x 8 root root 1024 10月 17 23:28 kerberos drwxr-xr-x 15 root root 6144 10月 17 23:30 lib drwxr-xr-x 4 root root 1024 10月 17 23:26 libexec drwxr-xr-x 12 root root 1024 10月 17 23:10 local drwxr-xr-x 2 root root 2048 10月 17 23:27 sbin drwxr-xr-x 29 root root 1024 10月 17 23:29 share drwxr-xr-x 2 root root 1024 2月 7 1996 src lrwxrwxrwx 1 root root 10 10月 17 23:10 tmp -> ../var/tmp [root@onlsbc1 usr]# ok. Java は正常にインストールされた。 (3). PATHを設定 ~/.bashrc を修正して Java の PATH を設定する。 [inoue@onlsbc1 inoue]$ pwd /home/inoue [inoue@onlsbc1 inoue]$ ls -la 合計 14 drwx------ 4 inoue inoue 1024 10月 18 17:09 . drwxr-xr-x 4 root root 1024 10月 17 23:30 .. -rw------- 1 inoue inoue 248 10月 18 17:44 .bash_history -rw-r--r-- 1 inoue inoue 24 10月 17 23:30 .bash_logout -rw-r--r-- 1 inoue inoue 191 10月 17 23:30 .bash_profile -rw-r--r-- 1 inoue inoue 124 10月 17 23:30 .bashrc -rw-r--r-- 1 inoue inoue 5531 10月 17 23:30 .canna drwx------ 2 inoue inoue 1024 10月 17 16:25 .ssh drwxrwxr-x 2 inoue inoue 1024 10月 21 14:20 Java [inoue@onlsbc1 inoue]$ vi .bashrc # .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi export PATH=$PATH:/usr/java/bin ".bashrc" 10L, 157C written [inoue@onlsbc1 inoue]$ [inoue@onlsbc1 inoue]$ source .bashrc [inoue@onlsbc1 inoue]$ which javac /usr/java/bin/javac [inoue@onlsbc1 inoue]$ java -version java version "1.4.1" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21) Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode) [inoue@onlsbc1 inoue]$ [inoue@onlsbc1 inoue]$ df -k Filesystem 1k-blocks Used Available Use% Mounted on /dev/hdc1 483886 316801 142089 70% / none 152332 0 152332 0% /dev/shm [inoue@onlsbc1 inoue]$ ok. Java は利用可能になった。 ---xxxx