?
Solved

Linux, java.exe and jar.exe

Posted on 2014-01-15
6
Medium Priority
?
633 Views
Last Modified: 2014-01-15
I am running on RHEL 6.5

I am using the following version of java

java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.7.1.el6_3-i386)
OpenJDK Server VM (build 23.7-b01, mixed mode)

Open in new window


What I want to do is to run jar.exe, but when I try that I get the following:

jar.exe
-bash: jar.exe: command not found

Open in new window


The jar.exe comes with the JDK, I thought I had the JDK, given th e java -version output above, but apparently I was mistaken.

How Can I easily install the 1.7 JDK

Hopefully with a yum install   ???

(Does not have to be 32 bit, I can handle a 64 bit java

THanks
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39782959
The name of the binary should be just "jar", not "jar.exe" under Linux.
0
 

Author Comment

by:Los Angeles1
ID: 39783006
Your right, did not think of that

However,  I tried the following:

jar
-bash: jar: command not found

Open in new window


So it appears that I need a NDK

Could you please tell me how to yum install a 1.7 JDK ?

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39783069
(Does not have to be 32 bit, I can handle a 64 bit java
Looks to me that you have a 32 JRE, so you should check if you've got the right version of that as well as installing a JDK
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:Los Angeles1
ID: 39783097
Yes, I put a 32 bit version of the FRE on there on  purpose originally, but now I need a JDK, and it will be much easier to install if its a 64 bit

Can someone please tell me how to yum install the 64 bit JDK for RHEL 6.x

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39783110
Not me i'm afraid - i'm rpm-phobic ;)
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 39783135
JDK comes with a complete JRE, so you will also get a new JRE when following the below instructions.

You can download the JDK from here:

JDK 7:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Install  with one of these commands (adjust the package name if needed):

rpm -Uvh /path/to/rpm/jdk-7u51-linux-i586.rpm # JDK  32bit

or

rpm -Uvh /path/to/rpm/jdk-7u51-linux-x64.rpm # JDK 64bit

Then use "alternatives" to make it known to your machine as the default (by creating appropriate links in /usr/bin).  Again, adjust the installation path name (the third parameter) if required:

java:
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_51/jre/bin/java 200000

javaws:
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_51/jre/bin/javaws 200000

javac/jar:
alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_51/bin/javac 200000
alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_51/bin/jar 200000

Don't forget to update the JAVA_HOME environment variable in /etc/profile or $HOME/.bash_profile.


Should you want to stay at your 7.0_09 version have a look here for the corresponding JDK:

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

You can also install both (09 and 51) and use "alternatives --config" to switch between versions.
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question