Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Java SE Development Kit (JDK)"

From Funtoo
Jump to navigation Jump to search
(Updated the install information. Will add information on how to use the jdk later....)
m (1.7)
 
(6 intermediate revisions by 2 users not shown)
Line 5: Line 5:
|Homepage=http://www.oracle.com/technetwork/java/javase/overview/index.html
|Homepage=http://www.oracle.com/technetwork/java/javase/overview/index.html
}}
}}
You can install the free icedtea jdk or Oracle's version.
Therefore we have a virtual package called ''virtual/jdk''. By default it will install the Oracle version.


== Installation ==
Jdk is {{package|dev-java/oracle-jre-bin}} & additional software for java development.
<console>
###i## emerge -a virtual/jdk
</console>


If you receive a message similar to the following, you will have to accept the Oracle java license to emerge the <code>oracle-jdk-bin</code>:
=== Installation ===
<console>
{{console|body=
###i## emerge virtual/jdk
###i## emerge dev-java/oracle-jdk-bin
Calculating dependencies... done!
}}
[##g##ebuild  N    ##!g##] ##g##dev-java/java-config-wrapper-0.16 ##!g##
[##g##ebuild  N    ##!g##] ##g##sys-apps/baselayout-java-0.1.0 ##!g##
[##g##ebuild  N    ##!g##] ##g##app-admin/eselect-java-0.1.0 ##!g##
[##g##ebuild  N    ##!g##] ##g##dev-java/java-config-2.2.0-r1000  ##!g## PYTHON_ABIS="##r##2.7 3.3##!r## ##bl##-2.6 -3.1 -3.2 -3.4 (-3.5)##!bl##"
[##g##ebuild  N    ##!g##] ##g##dev-java/oracle-jdk-bin-1.8.0.11 ##!g## USE="##r##X alsa fontconfig nsplugin##!r## ##bl##(-aqua) -derby -doc -examples -jce -pax_kernel (-selinux) -source##!bl##"


The following ##r##license changes##!r## are necessary to proceed:
=== Configuration ===
(see "package.license" in the portage(5) man page for more details)
==== JVM ====
# required by oracle-jdk-bin (argument)
list java virtual machines:
##g##>=dev-java/oracle-jdk-bin-1.8.0.11 Oracle-BCLA-JavaS##!g##
{{console|body=
</console>
###i## eselect java-vm list
}}


To accept the required license, create the directory <code>/etc/portage/package.license</code> if it does not already exist.
set java virual machine os oracle jdk:
<console>
{{console|body=
###i## mkdir /etc/portage/package.license
###i## eselect java-vm set system oracle-jdk-bin-1.7
</console>
}}


After we create this directory, portage will read files that we create inside of it to see that we have accepted licenses required to install certain packages. To accept the license for <code>oracle-jdk-bin</code>, create a file called something like <code>/etc/portage/package.license/oracle-jdk-bin</code> and add the line <code>dev-java/oracle-jdk-bin Oracle-BCLA-JavaS</code> to it:
==== Browser Plugin ====
<console>
list java browser plugins:
###i## tee /etc/portage/package.license/oracle-jdk-bin <<< "dev-java/oracle-jdk-bin Oracle-BCLA-JavaS"
{{console|body=
</console>
###i## eselect java-nsplugin list
}}


Now you can emerge <code>oracle-jdk-bin</code>
set java browser plugin to oracle jdk:
<console>
###i## emerge virtual/jdk
</console>


After the installation finishes, you may want to check and see if you can use the jdk. You can do so by issuing the following command:
===== 32bit =====
<console>
{{console|body=
$##i## java
###i## eselect java-nsplugin set 32bit oracle-jdk-bin-1.7
</console>
}}
 
===== 64bit =====
{{console|body=
###i## eselect java-nsplugin set 64bit oracle-jdk-bin-1.7
}}
 
=== Runtime ===
After the installation finishes, you may want to check and see if you can use the jre components of jdk. You can do so by issuing the following command:
 
{{console|body=
$##i## java -jar file.jar
}}
 
== media ==
{{#widget:YouTube|playlist=PLD22A26A9CD8A1A51}}
{{PageNeedsUpdates}}
{{PageNeedsUpdates}}
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 13:02, January 30, 2015

Java SE Development Kit (JDK)

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


Jdk is dev-java/oracle-jre-bin & additional software for java development.

Installation

root # emerge dev-java/oracle-jdk-bin

Configuration

JVM

list java virtual machines:

root # eselect java-vm list

set java virual machine os oracle jdk:

root # eselect java-vm set system oracle-jdk-bin-1.7

Browser Plugin

list java browser plugins:

root # eselect java-nsplugin list

set java browser plugin to oracle jdk:

32bit
root # eselect java-nsplugin set 32bit oracle-jdk-bin-1.7
64bit
root # eselect java-nsplugin set 64bit oracle-jdk-bin-1.7

Runtime

After the installation finishes, you may want to check and see if you can use the jre components of jdk. You can do so by issuing the following command:

user $ java -jar file.jar

media