akashm | hi all | 21:02 |
---|---|---|
nthykier | hi | 21:02 |
akashm | hi nthykier | 21:02 |
akashm | i have one question | 21:02 |
nthykier | Unless it is a question about how to code in Java, I might have an answer | 21:03 |
akashm | :) | 21:03 |
akashm | I 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 |
akashm | 1. If I run test.jar from shell i.e. | 21:04 |
akashm | $java -jar test.jar | 21:04 |
akashm | I get "/home/akashm/Desktop/IDE/test/" as output. | 21:04 |
akashm | 2. If I run test.jar by double clicking it then I get | 21:04 |
akashm | "/home/akashm" as output. | 21:04 |
nthykier | I think this is pretty standard behaviour actually. Programs that you double click have their current dir set to your $HOME as I recall | 21:05 |
akashm | :'( | 21:06 |
nthykier | eqv to doing (something like): cd ~ && java -jar /home/akashm/Desktop/IDE/test/test.jar | 21:06 |
akashm | so, what should i do to come out of this scenario? | 21:06 |
nthykier | Depends on what you are trying to do | 21:07 |
nthykier | If 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 that | 21:10 |
nthykier | btw, 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 |
akashm | yeah | 21:12 |
akashm | even i dont want user to run my jar in terminal | 21:13 |
nthykier | shouldn't matter how they run it | 21: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!