Changeset d7df10f3
- Timestamp:
- 03/29/2014 08:32:20 PM (9 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 7.10, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, ken/inkscape-core-mods, krejzi/svn, lazarus, nosym, perl-modules, plabs/python-mods, qt5new, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/soup3, xry111/test-20220226
- Children:
- 9ceb07f
- Parents:
- 7f8868f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
general/prog/java.xml
r7f8868f rd7df10f3 25 25 </sect1info> 26 26 27 <title> About Java</title>27 <title>Java-&openjdk-version;</title> 28 28 29 29 <indexterm zone="java"> … … 32 32 33 33 34 <para>Java is different from most of the packages in LFS and BLFS. It 35 is a programming language that works with files of byte codes to obtain 36 instructions and executes then in a Java Virtual Machine (JVM). An 37 introductory java program looks like:</para> 34 <sect2> 35 <title>About Java</title> 36 <para>Java is different from most of the packages in LFS and BLFS. It 37 is a programming language that works with files of byte codes to obtain 38 instructions and executes then in a Java Virtual Machine (JVM). An 39 introductory java program looks like:</para> 38 40 39 41 <screen><literal>public class HelloWorld … … 45 47 }</literal></screen> 46 48 47 <para>This program is saved as <filename>HelloWorld.java</filename>. The file 48 name, <emphasis>HelloWorld</emphasis>, must match the class name. It 49 is then converted into byte code with <command>javac HelloWorld.java</command>. 50 The output file is <filename>HelloWorld.class</filename>. The program is 51 executed with <command>java HelloWorld</command>. This creates a JVM and 52 runs the code. The 'class' extension must not be specified.</para> 49 <para>This program is saved as <filename>HelloWorld.java</filename>. The 50 file name, <emphasis>HelloWorld</emphasis>, must match the class name. It 51 is then converted into byte code with 52 <command>javac HelloWorld.java</command>. The output file is 53 <filename>HelloWorld.class</filename>. The program is executed with 54 <command>java HelloWorld</command>. This creates a JVM and runs the 55 code. The 'class' extension must not be specified.</para> 53 56 54 <para>Several class files can be combined into one file with the55 <command>jar</command> command.This is similar to the standard56 <command>tar</command> command. For instance, the command <command>jar cf myjar.jar57 *.class</command> will combine all class files in a directory into one jar58 file.These act as library files.</para>57 <para>Several class files can be combined into one file with the 58 <command>jar</command> command. This is similar to the standard 59 <command>tar</command> command. For instance, the command 60 <command>jar cf myjar.jar *.class</command> will combine all class files 61 in a directory into one jar file. These act as library files.</para> 59 62 60 <para>The JVM can search for and use classes in jar files automatically. It61 uses the <envar>CLASSPATH</envar> environment variable to search for jar files.62 This is a standard list of colon-separated directory names similar to63 the <envar>PATH</envar> environment variable.</para>63 <para>The JVM can search for and use classes in jar files automatically. 64 It uses the <envar>CLASSPATH</envar> environment variable to search for 65 jar files. This is a standard list of colon-separated directory names 66 similar to the <envar>PATH</envar> environment variable.</para> 64 67 65 &lfs75_checked;68 </sect2> 66 69 67 70 <sect2 id="java-bin" xreflabel="Java Binary" role="package"> … … 78 81 directory to allow for multiple installations, including a source based 79 82 version.</para> 83 84 &lfs75_checked; 80 85 81 86 <bridgehead renderas="sect3">Binary Package Information</bridgehead> … … 123 128 <xref linkend="xorg7-lib"/> 124 129 </para> 130 125 131 </sect2> 126 132 … … 137 143 138 144 <para>Configure the temporary <application>OpenJDK</application> 139 installation with the following commands:</para> 145 installation by issuing the following commands (note that if you logout 146 and login back before having definitely configured 147 <xref linkend='openjdk'/>, you'll have to issue them again):</para> 140 148 141 149 <screen><userinput>export CLASSPATH=.:/usr/share/java && 150 export JAVA_HOME=/opt/OpenJDK-&openjdk-version;-bin && 142 151 export PATH="$PATH:/opt/OpenJDK-&openjdk-version;-bin/bin"</userinput></screen> 152 153 <para> Do not forget to reboot or to source the profile file after 154 modification.</para> 143 155 144 156 <para>The binary version is now installed. If you don't want to compile the
Note:
See TracChangeset
for help on using the changeset viewer.