Difference between pages "Installing Java" and "Make.conf"

From Funtoo
(Difference between pages)
Jump to: navigation, search
 
(Where does this file reside?)
 
Line 1: Line 1:
== What is Java? What purpose does it serve? ==
+
== What is the make.conf file? What is its purpose? ==
==== Definition ====
+
Make.conf is Portage's main configuration file. It contains many variables that define how a package will installed in a Funtoo system. The really cool thing about portage is that you can customize a great amount of how it installs packages, what packages it installs, how it builds those packages, etc. A great deal of this customization is done through the make.conf file. This page will attempt to explain the uses of the make.conf file, different variables that can be added to it, and their uses.  
"Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!" ([http://www.java.com/en/download/faq/whatis_java.xml Oracle page on Java])
+
  
==== JRE vs. JDK ====
+
==== Where does this file reside? ====
* '''JRE''': Just the Java Virtual Machine.
+
The make.conf file is found at '''/etc/portage/make.conf''' and can be viewed and edited by running the following command as root:
* '''JDK''': The Java Software Development Kit - this includes command line tools for launching <code>.jar</code> files, the JRE, compilers, and tools for creating Java-based programs.
+
== Installing java ==
+
==== Options for JRE and JDK ====
+
On Funtoo, there are several different java packages that you can emerge:
+
* '''{{Package|virtual/jre}}''' - When you emerge this, it pulls in the java runtime environment for your current profile.
+
* '''{{Package|virtual/jdk}}''' - When you emerge this, it pulls in the java development kit for your current profile.
+
* '''{{Package|dev-java/icedtea}}''' - A Gentoo-made binary of the IcedTea JDK, this is the JDK pulled in when you emerge <code>virtual/jdk</code> on the desktop profile.  
+
* '''{{Package|dev-java/oracle-jdk-bin}}''' - Oracle's version of the Java Development Kit. This package and <code>dev-java/oracle-jre-bin</code> both require you to manually download the file and place it in <code>/usr/portage/distfiles</code> due to the fact that Oracle wants you to accept a license before downloading the package.
+
* '''{{Package|dev-java/oracle-jre-bin}}''' - Similar to the above, this only includes the Java Runtime Environment.
+
 
+
==== Emerging java ====
+
To install java, run the following command:
+
 
<console>
 
<console>
###i## emerge -av virtual/jdk
+
##r### ##b##nano /etc/portage/make.conf
 
+
These are the packages that would be merged, in order:
+
 
+
Calculating dependencies... done!
+
[ebuild  N    ] dev-java/java-config-wrapper-0.16  8 kB
+
[ebuild  N    ] sys-apps/baselayout-java-0.1.0  71 kB
+
[ebuild  N    ] dev-java/java-config-2.2.0-r1000:2  PYTHON_ABIS="2.7 3.3 -2.6 -3.1 -3.2 (-3.4)" 51 kB
+
[ebuild  N    ] app-admin/eselect-java-0.1.0  71 kB
+
[ebuild  N    ] dev-java/icedtea-bin-7.2.3.9:7  USE="X alsa cups -cjk -doc -examples -nsplugin -source" 47,781 kB
+
[ebuild  N    ] virtual/jdk-1.7.0:1.7  0 kB
+
[ebuild  N    ] virtual/jre-1.7.0:1.7  0 kB
+
Would you like to merge these packages? [Yes/No] ##i##yes
+
 
</console>
 
</console>
 
== Testing to see if it emerged ==
 
To check that java installed on your system, run the following command:
 
<console>
 
$##i## java -version
 
</console>
 
If you get something like this, you are ready to use java!:
 
<console>
 
java version "1.7.0_21"OpenJDK Runtime Environment (IcedTea 2.3.9) (Gentoo build 1.7.0_21-b02)OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
 
</console>
 
 
To be double sure that the java package you emerged is functional, you can run the following:
 
<console>
 
$##i## java-config --list-available-vms
 
The following VMs are available for generation-2:
 
*)      IcedTea JDK 7.2.3.9 [icedtea-bin-7]
 
</console>
 
 
== Using the java command ==
 
==== Overview of the command ====
 
The java command can be run like so:
 
* '''java [options] class [argument ...]'''
 
* '''java [options] -jar file.jar [argument ...]'''
 
 
==== Example command usage ====
 
Compiling code:
 
<console>
 
$##i## javac -d bin -sourcepath src -cp lib/lib1.jar;lib/lib2.jar src/com/example/Application.java
 
</console>
 
 
Running code:
 
<console>
 
$##i## java -cp bin;lib/lib1.jar;lib/lib2.jar com.example.Application
 
</console>
 
 
Running a jarfile:
 
<console>
 
$##i## java -jar Application.jar
 
</console>
 
 
== More Information ==
 
* [http://docs.oracle.com/javase/ Java SE at Oracle.com]
 
* [http://en.wikipedia.org/wiki/Java_(programming_language) Wikipedia article]
 
* [http://docs.oracle.com/javase/tutorial/ Very informative tutorials]
 
 
== Sources ==
 
([http://www.sergiy.ca/how-to-compile-and-launch-java-code-from-command-line/ Information provided for example command usage])
 
  
 
[[Category:System]]
 
[[Category:System]]

Revision as of 22:58, 28 October 2013

What is the make.conf file? What is its purpose?

Make.conf is Portage's main configuration file. It contains many variables that define how a package will installed in a Funtoo system. The really cool thing about portage is that you can customize a great amount of how it installs packages, what packages it installs, how it builds those packages, etc. A great deal of this customization is done through the make.conf file. This page will attempt to explain the uses of the make.conf file, different variables that can be added to it, and their uses.

Where does this file reside?

The make.conf file is found at /etc/portage/make.conf and can be viewed and edited by running the following command as root:

# nano /etc/portage/make.conf