LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 07-22-2013, 02:43 PM   #1
MikeyXX
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Rep: Reputation: 0
can run java -jar in Downloads directory, but not one made off my home


It's weird, if I run java -jar on a .jar file in a directory I created under my home directory, it says it can't access the .jar file. But if I move the .jar file to the Downloads directory, it works just fine. Here is a permission list of the two directories:

drwxrwxrwx 3 michael michael 4096 Jul 22 14:44 Downloads

drwxrwxrwx 4 michael michael 4096 Jul 22 14:44 Ducky

If I run the "java -jar jarfile.jar" within Ducky, it comes back saying it cannot access the file jarfile.jar. But if I copy the file out of there, put it in Downloads, and then copy it back. It works. The permissions change it seems as the colour of original file was red and the newly copied file is green. I don't know why it was working.

Can anyone explain it? (type slowly please )
 
Old 07-22-2013, 03:25 PM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 13,031

Rep: Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740
well with out more info
This is only a wild guess

the "Downloads" folder is in your users $PATH
and the random named folder is NOT

by the way are you using a ./ in the command line to tell the terminal to USE the folder you are in
Code:
cd ~/FolderName
java -jar ./jarfile.jar
 
Old 07-22-2013, 06:01 PM   #3
MikeyXX
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks John, that was my first thought. I echo'd the $PATH variable and neither show up in it. And I did run it as you indicated as one of my attempts. Interesting update. I moved the .jar file back from Downloads and into the Ducky directory...and now it works, it can be accessed by the java. How wierd is that?
 
  


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
[SOLVED] trying to run "java -jar start.jar" at boot Centos6.4 nschklar Linux - Newbie 2 06-09-2013 08:10 PM
Cant run a java that sends email using mail.jar ralexrdz Linux - Server 1 01-30-2013 10:17 AM
java, .jar don't run on fedora 6 Yentor Linux - Software 1 05-27-2007 04:01 PM
How to run JAR from within Java program ?! EAD Programming 1 12-31-2006 07:11 PM
How to run a java jar file. sabliny Programming 7 11-05-2005 01:59 PM


All times are GMT -5. The time now is 12:27 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