Solved

Linux, java.exe and jar.exe

Posted on 2014-01-15
6
565 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

707 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

11 Experts available now in Live!

Get 1:1 Help Now