Solved

Linux, java.exe and jar.exe

Posted on 2014-01-15
6
597 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

749 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