Solved

Linux, java.exe and jar.exe

Posted on 2014-01-15
6
573 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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 500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now