LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2005, 09:57 AM   #1
s0450776
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Rep: Reputation: 0
why is jar command not found?


hi

i installed java runtime environment and java media framework in order to run video annotation software. The annotation software download requires unpack of .zip file using JAR. When i try using JAR command it said:

bash: jar: command not found

I tried also installing jdk package but i still get the same response. I tried find jar and got:

find: jar: No such file or directory

I am puzzled but a total newbie so it could be anything.

Any help would be greatly appreciated

Ps. i rebooted after installation and use mandrake 10.1
 
Old 06-27-2005, 10:07 AM   #2
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
tell me how do you install the java runtime and its media framework???
 
Old 06-27-2005, 10:30 AM   #3
s0450776
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Original Poster
Rep: Reputation: 0
sorry, can't remeber exactly, but followed the instructions at java.sun...
i downloaded to home directory and then,

for jre:

chmod a+x jre-1_5_0_<version>-linux-i586-rpm.bin

./jre-1_5_0_<version>-linux-i586-rpm.bin

for jmf:
/bin/sh ./jmf-2_1_1e-linux-i586.bin


for jdk :
chmod a+x jdk-1_5_0_<version>-linux-i586-rpm.bin
./jdk-1_5_0_<version>-linux-i586-rpm.bin
rpm -iv jdk-1_5_0_04-linux-i586.rpm

Apologies for not being clearer - don't really know what i am doing
 
Old 06-27-2005, 11:31 AM   #4
dave_starsky
Member
 
Registered: Oct 2003
Location: UK, Manchester
Distribution: Gentoo (2.6.10-r4) & Ubuntu
Posts: 145

Rep: Reputation: 16
You might need to add the directory with jar in it to your $PATH, you can do this through /etc/profile or through your ~/.bashrc with

Code:
export PATH = $PATH:/path/to/jar/directory

Last edited by dave_starsky; 06-27-2005 at 11:32 AM.
 
1 members found this post helpful.
Old 06-27-2005, 11:48 AM   #5
s0450776
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Original Poster
Rep: Reputation: 0
this is really stupid, but does that mean navigate to /etc/profile and execute the command? i tried to navigate to /etc/profile but it is not a directory - there is a profile.d.

i also tried ~/.bashrc but got

bash: /root/.bashrc: Permission denied

(i logged on as root with password but got the same)

thanks
 
Old 06-28-2005, 07:40 AM   #6
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
You installed java sdk, but previously you installed java runtime. Why???? Java sdk has already java runtime. Try to log as normal user then run jar command.
 
Old 06-28-2005, 09:04 PM   #7
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
Quote:
Originally posted by s0450776
this is really stupid, but does that mean navigate to /etc/profile and execute the command? i tried to navigate to /etc/profile but it is not a directory - there is a profile.d.

i also tried ~/.bashrc but got

bash: /root/.bashrc: Permission denied

(i logged on as root with password but got the same)

thanks
~/.bashrc is a file that gets sourced when you start up a bash shell. So if you edit it, you should be able to find a line in it somewhere that is adding to the PATH. If not, you can just add a line like:

Code:
PATH=$PATH:/usr/local/bin/
Or wherever jar is located on your system. On my system, it is /usr/bin/jar, but I guess yours was installed somewhere else.
 
1 members found this post helpful.
Old 06-28-2005, 10:37 PM   #8
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
i suggest you don't use the root account for usual stuff. As root put this in the file /etc/profile

JAVA_HOME=/usr/java/jdk_directory
export JAVA_HOME

PATH=$JAVA_HOME/bin:$PATH
export PATH
 
Old 07-22-2011, 03:29 AM   #9
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Rep: Reputation: Disabled
Wink worked

thanks for the help first i tried entering root and editing .bashrc with winscp and adding the line
export PATH = $PATH:/opt/jdk-6u26/bin
and then saving the file but it didn't work but then i just typed in command prompt
export PATH = $PATH:/opt/jdk-6u26/bin and got the error
-bash: export: `=': not a valid identifier
so i removed the spaces and it worked (export PATH=$PATH:/opt/jdk-6u26/bin)
although i am bewildered as i followed all the instructions when installing the java development rootkit and one of the final instructions was to export some paths.

Last edited by Majed17; 07-22-2011 at 03:31 AM.
 
Old 03-08-2012, 08:01 AM   #10
simo_s
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
/bin/bash: jar : commande introuvable

Hello
I'm trying to build android system following this tutorial http://code.google.com/p/seek-for-an...ngTheSystemand I installed the jdk6 from the sun web site
I'm on ubuntu 11.10
When I run make update-api I have this error : host Java: jsr305lib (out/host/common/obj/JAVA_LIBRARIES/jsr305lib_intermediates/classes)
/bin/bash: jar : commande introuvable
make: *** [out/host/common/obj/JAVA_LIBRARIES/jsr305lib_intermediates/javalib.jar] Erreur 127.
I don't find any solution on internet.
Please can someone help me.
 
Old 03-08-2012, 08:13 AM   #11
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,881
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
You may have no JDK installed, or your jdk/bin directory is not on the PATH
For example in my system:

Code:
/opt/jdk1.6.0_21/ -- here is JDK installed
/opt/jdk -> symlink to jdk1.6.0_21

/etc/profile contains these lines:

export JAVA_HOME=/opt/jdk
export "PATH=$PATH:$JAVA_HOME/bin"
So you should check if JDK is installed, where is it installed, and how could you add its 'bin' directory to the PATH.
 
Old 09-08-2012, 09:41 AM   #12
android-builder
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Hi Simo_s,

Looks like you already install jdk manually, is may be that jar is not registered in your java path.

you can do the following simbol link,

sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0/bin/jar" 1

You can change "/usr/lib/jvm/jdk1.6.0" to your jdk install directory.

finally run jar to see if it is working, then continue build

ketosis@android-builder:~$ jar
Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-e specify application entry point for stand-alone application
bundled into an executable jar file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: <command name> command not found smash Programming 5 03-13-2006 08:48 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
cd.. command not found?!? xtremcoder Fedora 4 10-06-2004 04:43 PM
making a jar open a command window when double-clicked Neuromancer47 Programming 5 07-15-2004 11:27 AM
Mandrake and the command java -jar silent1_22 Linux - Distributions 3 11-23-2002 06:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration