% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math} % this also loads fontspec
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
  % xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
  pdftitle={alternatives-and-java-versions},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{alternatives-and-java-versions}
\author{}
\date{}

\begin{document}
\maketitle

\hypertarget{alternatives-and-java-versions}{%
\section{alternatives-and-java-versions}\label{alternatives-and-java-versions}}

alternatives and java versions
\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#

This post discusses the alternatives utility by showing how to maintain
multiple java versions side-by-side.

My os is fedora 18 x64 but I need java 32bit so I installed it from
official oracle site.

.. code-block:: console

which java /usr/bin/java

\# display sudo alternatives --display java

\# alternatives --install sudo alternatives --install /usr/bin/java java
/usr/java/latest/bin/java 15

\# configure java to use newly installed version sudo alternatives
--config java

\begin{verbatim}
There are 2 programs which provide 'java'.

  Selection    Command
  -----------------------------------------------
  *  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   + 2           /usr/java/latest/bin/java

  Enter to keep the current selection[+], or type selection number: 2
\end{verbatim}

\# display sudo alternatives --display java

\end{document}
