LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-31-2012, 01:53 PM   #1
fachhoch@gmail.com
Member
 
Registered: Apr 2010
Posts: 82

Rep: Reputation: 1
error- unable to access jar file


I have a script which downloads a jar file using wget and the next line is java -jar /....path/my.jar

when I run this script if fails with Unable to access jarfile ......../path/my.jar

and when I run this jar file from the shell it works here is my script file

Code:
#!/bin/sh
export JAVA_HOME=/opt/java/
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
rm -rf /opt/artms/config/ec2-config.jar
wget  -O /opt/artms/config/ec2-confg.jar  https://blah...blah/blah../config/ec2-config.jar

sudo java -jar /opt/artms/config/ec2-config.jar

please advice me.
 
Old 05-31-2012, 06:16 PM   #2
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 86
Possibilities *might* include:

* You may have something defined in your shell environment that you don't have exported, so it's not accessible to your script.
* Something you have defined in your shell environment works, but you have redefined it in your script.

What happens if you, for example:
* Start at a command prompt from which you can successfully run the jar.
* At the prompt, start another shell.
* At the new prompt, define the two values you have defined in your script.

Can you then still run the jar, or do you get the same error?
 
Old 05-31-2012, 08:24 PM   #3
fachhoch@gmail.com
Member
 
Registered: Apr 2010
Posts: 82

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by kakaka View Post
Possibilities *might* include:

* You may have something defined in your shell environment that you don't have exported, so it's not accessible to your script.
* Something you have defined in your shell environment works, but you have redefined it in your script.

What happens if you, for example:
* Start at a command prompt from which you can successfully run the jar.
* At the prompt, start another shell.
* At the new prompt, define the two values you have defined in your script.

Can you then still run the jar, or do you get the same error?
I resolved it I had a wrong spell
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Error running a .sh script when extracted from a jar file. albert_newton Linux - General 6 01-05-2010 09:51 PM
I got error with this command 'java -jar NodeView-v1.1.jar' mohdismiaswaly Linux - Software 3 04-23-2009 06:24 AM
Unable to access file on web server Ryan_Sutton Linux - Newbie 2 11-19-2008 03:21 PM
.Jar file execution error on FC7 immortaltechnique Linux - Software 6 12-21-2007 04:26 AM
Java apps runs fine but gives error from jar file-NoClassDefFoundError lbyrd Linux - Software 5 04-25-2006 11:50 AM


All times are GMT -5. The time now is 04:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration