Install Idea IntelliJ in Fedora 23

Prerequisite:

Download the archive file for community or ultimate edition from the official website:

https://www.jetbrains.com/idea/download/#section=linux

The file will look similar to “ideaIC-15.0.2.tar.gz” in case of community edition.

Note: The community edition is a free version, while ultimate edition is a paid version which comes with one month free trial.

Installation Steps:

  • Copy the archive file to a desired location:

sudo cp ideaIC-15.0.2.tar.gz /opt/

  • Extract the archive file:

sudo tar -xvf ideaIC-15.0.2.tar.gz

  • Create symbolic links so that the IDE can be opened from any location:

ln -sf /opt/idea-IC-143.1184.17 /opt/idea
ln -s /opt/idea/bin/idea.sh /usr/local/bin/idea

  • Open the IntelliJ IDE by the running the following command:

idea

  • Create a desktop launcher:
    To create a desktop launcher create a idea.desktop file in the Desktop folder inside the HOME folder. Copy paste the following contents in the file:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=IntelliJ IDEA
GenericName=Java IDE
Comment=IntelliJ IDEA.
Exec=idea
Icon=/opt/idea/bin/idea.png
Terminal=false
Type=Application
Categories=Development;IDE

Install Apache Maven in Fedora 23

Prerequisite:

  • JDK must be installed in the system.
  • Download the binary tar .gz archive file from the Apache Maven website, i.e., from the location https://maven.apache.org/download.cgi. The file will look similar to “apache-maven-3.3.9-bin.tar.gz”.

Installation:

  1. Create a new folder say “apache-maven” inside the location “/usr/local/” by running the command:

    sudo mkdir -p /usr/local/apache-maven

  2. Move the downloaded “apache-maven-3.3.9-bin.tar.gz” file to the above created folder location by running the command:

    sudo mv apache-maven-3.3.9-bin.tar.gz /usr/local/apache-maven

  3. Go to the folder location:

    cd /usr/local/apache-maven

  4. Extract the contents of the archive file:

    sudo tar -xzvf apache-maven-3.3.9-bin.tar.gz

  5. You have to set some variables like M2_HOME, M2, MAVEN_OPTS and PATH, which can be done by editing either “.profile” or “.bash_profile” file in the user’s HOME folder, or editing “/etc/profile” file. Editing the files inside the HOME folder will effect the user’s shell, while editing “/etc/profile” will make the changes available system-wide.To edit the file the command will be:

    sudo gedit
    or,
    sudo vi

    For example, to edit “/etc/profile” the command will be

    sudo gedit /etc/profile
    or,
    sudo vi /etc/profile

    The above commands will open file for editing.

  6. Add the following contents at the end of the file mentioned in Step5:

    export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
    export M2=$M2_HOME/bin
    export MAVEN_OPTS=”-Xms256m -Xmx512m”
    export PATH=$M2:$PATH

    Note: The path mentioned in the 1st line to set M2_HOME should be the location where the file gets extracted in Step2.

  7. Execute the following command:

    sudo update-alternatives –install “/usr/bin/mvn” “mvn” “/usr/local/apache-maven/apache-maven-3.3.9/bin/mvn” 1

    Note: The file location “/usr/local/apache-maven/apache-maven-3.3.9/bin/mvn” should be present inside the extracted folder in Step2.

  8. Check the maven installation by running the command:

    mvn -version

    You should get the output similar to below:

    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
    Maven home: /usr/local/apache-maven-3.3.9
    Java version: 1.8.0_66, vendor: Oracle Corporation
    Java home: /usr/java/jdk1.8.0_66/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: “linux”, version: “4.2.3-300.fc23.x86_64”, arch: “amd64”, family: “unix”

Install Oracle JDK & JRE in Fedora 23

Prerequisite:

Download the rpm files for jdk and jre from the oracle website [1].

The downloaded file will have names similar to jdk-8u66-linux-x64.rpm and jre-8u66-linux-x64.rpm respectively.

Remove Pre-installed OpenJDK:

Fedora 23 comes with OpenJDK by default. To know the details of already installed Java enter the following command:

rpm -qa | grep jdk

You will get an output as follows:
java-1.8.0-openjdk-headless-1.8.0.60-14.b27.fc23.x86_64

To remove the above OpenJDK package, enter the following command:

sudo yum remove <package-name>
or,
sudo dnf remove <package-name>

For above example, the command will be as follows:

sudo dnf remove java-1.8.0-openjdk-headless-1.8.0.60-14.b27.fc23.x86_64

It will ask to remove multiple packages, type ‘y’ to proceed.

Installation of Oracle JDK & JRE:

  • Install Oracle JDK rpm package:

rpm -Uvh <path-to-jdk-rpm>

Example: rpm -Uvh jdk-8u66-linux-x64.rpm

  • Install Oracle JRE rpm package:

rpm -Uvh <path-to-jre-rpm>

Example: rpm -Uvh jre-8u66-linux-x64.rpm

  • Install java:

alternatives –install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

  • Install javaws:

alternatives –install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

  • Install Java Browser (Mozilla) Plugin:

For 32-bit:

alternatives –install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 20000

For 64-bit:

alternatives –install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 20000

  • Install javac (if JDK is installed):

alternatives –install /usr/bin/javac javac /usr/java/latest/bin/javac 20000
alternatives –install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

References:

  1. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. https://ask.fedoraproject.org/en/question/8943/how-to-install-java-in-fedora-17/