/
1.3.3. Customize Java environment

1.3.3. Customize Java environment

Before starting the installation of Redhat FUSE or Apache Tomcat there is to install Java SE 7 in the Operating System.

  • Download and install Java SE 7

    1-      Download the Java SE 7 JDK and required components.
    Download the development kit, documentation and cryptography extension for Java SE 7.
    Used ~/Downloads/bundle_fuse/JAVA/SE7/as download directory
     

    FileName:

    Download Java SE Development Kit 7u80, you must accept the license and use the Oracle credentials to download:

    jdk-7u80-linux-x64.tar.gz

    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u80-oth-JPR

    FileName:

    Download Java SE Development Kit 7u80 Documentation, the documentation for the JDK:

    jdk-7u80-docs-all.zip

    http://www.oracle.com/technetwork/java/javase/downloads/java-se-7-doc-download-435117.html

    FileName:

    Download Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7:

    UnlimitedJCEPolicyJDK7.zip

    http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/jce-7-download-432124.html

    2-      Removal of components.
    The JDK, the documentation and the JCE are extracted in / usr / local / with the following actions.

    Administrator privileges

     su root

    Extract the JDK in /usr/ local/ and remove the tablet

    cd /usr/local
    cp ~/Downloads/bundle_fuse/JAVA/SE7/jdk-7u80-linux-x64.tar.gz .
    tar xzf jdk-7u80-linux-x64.tar.gz
    rm jdk-7u80-linux-x64.tar.gz

    We extract the documentation and the extension of cryptography

    cd /usr/local/jdk1.7.0_80/
    cp ~/Downloads/bundle_fuse/JAVA/SE7/jdk-7u80-docs-all.zip .
    cp ~/Downloads/bundle_fuse/JAVA/SE7/UnlimitedJCEPolicyJDK7.zip .
    unzip jdk-7u80-docs-all.zip
    rm jdk-7u80-docs-all.zip
    unzip UnlimitedJCEPolicyJDK7.zip
    cd UnlimitedJCEPolicy/
    cp -i *** ../jre/lib/security/
    cd ..
    chown root:root -R jdk1.7.0_80/

  • Download and install other Java tools

    1-      Download additional Java tools
    Download Apache Ant, Apache Groovy and Apache Maven.
    Used ~ /Downloads/bundle_fuse/JAVA/TOOLS/ as download directory

    FileName:

     Download Apache Ant 1.9.9:

    apache-ant-1.9.9-bin.tar.gz

     http://apache.rediris.es//ant/binaries/apache-ant-1.9.9-bin.tar.gz

    FileName:

     Download Apache Ant 2.4.9:

    apache-groovy-binary-2.4.9.zip

     https://bintray.com/groovy/maven/download_file?file_path=apache-groovy-binary-2.4.9.zip

    FileName:

     Download Apache Ant 3.3.9:

    apache-maven-3.3.9-bin.tar.gz

     https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz

    2-      Extracción de los componentes.
    Se extraen el JDK, la documentación y el JCE en /usr/local/ con las siguientes acciones. 

    Administrator privileges

    su root

    Copy the compressed to /usr/local/

    cp ~/Downloads/bundle_fuse/JAVA/TOOLS/apache-ant-1.9.9-bin.tar.gz .
    cp ~/Downloads/bundle_fuse/JAVA/TOOLS/apache-maven-3.3.9-bin.tar.gz .
    cp ~/Downloads/bundle_fuse/JAVA/TOOLS/apache-groovy-binary-2.4.9.zip .

    Extract compressed

    tar xzf apache-ant-1.9.9-bin.tar.gz
    tar xzf apache-maven-3.3.9-bin.tar.gz
    unzip apache-groovy-sdk-2.4.9.zip

    Delete comrpessed

    rm apache-ant-1.9.9-bin.tar.gz
    rm apache-maven-3.3.9-bin.tar.gz
    rm apache-groovy-binary-2.4.9.zip

  • Creating support scripts for Java environment

In this section, support scripts are created in order to configure and reconfigure the Java environment in the machine quickly and easily.

1-      Create the directory and files to fill

cd ~
mkdir bin
cd bin
touch setenv7.0.80_BASE
touch setenv7.0.80_FULL
chmod ugo+x setenv7.0.80_BASE
chmod ugo+x setenv7.0.80_FULL 

2-      Fill in the scripts with their respective contents

Contens of ~/bin/setenv7.0.80_BASE 

 
#!/bin/bash

  1. -----------------------------------------
  2. NOTE: To be invoked as "source ..."
  3. -----------------------------------------
    export JAVA_HOME=/usr/local/jdk1.7.0_80
    export PATH=$JAVA_HOME/bin:$PATH
    clear
    echo JAVA_HOME[${JAVA_HOME}]
    echo PATH[${PATH}]
    java -version 

Contents of ~/bin/setenv7.0.80_FULL 


#!/bin/bash

  1. -----------------------------------------------------------------
  2. NOTA: para ser invocado como "source ..."
  3. -----------------------------------------------------------------
    export JAVA_HOME=/usr/local/jdk1.7.0_80
    export ANT_HOME=/usr/local/apache-ant-1.9.9
    export M2_HOME=/usr/local/apache-maven-3.3.9
    export GROOVY_HOME=/usr/local/groovy-2.4.9
    export M2=$M2_HOME/bin
    export MAVEN_OPTS="-Xms256m -Xmx512m -Dmaven.artifact.threads=3"
    export PATH=$JAVA_HOME/bin:$M2:$ANT_HOME/bin:$GROOVY_HOME/bin:$PATH
    clear
    echo JAVA_HOME[${JAVA_HOME}]
    echo PATH[${PATH}]
    java -version
    ant -version
    mvn --version
    groovy version  

3-      Add alias for scripts to: .bashrc

Edit ~/.bashrc and add the line instructions

alias SJ7080BASE='source $HOME/bin/setenv7.0.80_BASE'
alias SJ7080FULL='source $HOME/bin/setenv7.0.80_FULL'

Related content

3. Configuración del entorno Java
3. Configuración del entorno Java
More like this
1.3.7. FUSE Installation
1.3.7. FUSE Installation
More like this
1.3.2. Create new Machine
1.3.2. Create new Machine
More like this
1.3.8. Additional setup for Fuse, Tomcat and certificates.
1.3.8. Additional setup for Fuse, Tomcat and certificates.
More like this
1.3. b+SII Red Hat FUSE
1.3. b+SII Red Hat FUSE
More like this
1.3.11. FUSE bundles installation
1.3.11. FUSE bundles installation
More like this

Avvale 2024