/srv/irclogs.ubuntu.com/2010/10/09/#ubuntu-java.txt

akashmhi all21:02
nthykierhi21:02
akashmhi nthykier21:02
akashmi have one question21:02
nthykierUnless it is a question about how to code in Java, I might have an answer21:03
akashm:)21:03
akashmI have created a test.jar file that will execute "pwd" command and will write it to pathFile. I am able to run the test.jar by double clicking on it. location of test.jar is "/home/akashm/Desktop/IDE/test/test.jar".Now I have following problems-21:04
akashm1. If I run test.jar from shell i.e.21:04
akashm$java -jar test.jar21:04
akashmI get "/home/akashm/Desktop/IDE/test/" as output.21:04
akashm2. If I run test.jar by double clicking it then I get21:04
akashm"/home/akashm" as output.21:04
nthykierI think this is pretty standard behaviour  actually. Programs that you double  click have their current dir set to your $HOME as I recall21:05
akashm:'(21:06
nthykiereqv to doing (something like): cd ~ && java -jar /home/akashm/Desktop/IDE/test/test.jar21:06
akashmso, what should i do to come out of this scenario?21:06
nthykierDepends on what you are trying to do21:07
nthykierIf you are trying to find resources or  the path to the "test.jar" then it is possible. However, getting the exact code to accomplish, you may want to use google or #java (on this network) - either of them may know how to do that21:10
nthykierbtw, I believe you have a similar issue on Windows (not that your average Windows user is likely to use the terminal to run the jar file)21:10
akashmyeah21:12
akashmeven i dont want user to run my jar in terminal21:13
nthykiershouldn't matter how they run it21:18
nthykier(unless it is a webapp or something similar)21:18

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!