Solved

Linux, java.exe and jar.exe

Posted on 2014-01-15
6
612 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

717 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