Linked Questions

0 votes
1 answer
6k views

I cant figure out why System.getProperty("home.dir") is returning null instead of the current working directory. I am using Eclipse Mars2.0 IDE on Ubuntu 16.04. I guess, this hardly matters which IDE ...
Avirup Das's user avatar
1 vote
2 answers
724 views

How would you find the current directory which the CMD is currently in from a java file which has been exported and converted into a .exe file. I'm not looking for the current working directory as ...
Sam's user avatar
  • 88
0 votes
1 answer
573 views

In my program I did File jarFile = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().getPath()); execPath = String.valueOf(jarFile.getParentFile()); To get the execPath = to ...
Hugo Abreu's user avatar
0 votes
1 answer
392 views

Part of my (java) code needs to access a database. When opening a connection it checks if the actual database file exists (I use sqlite). I want to make my code portable, so I want to avoid hard ...
franchar's user avatar
2 votes
0 answers
235 views

How to know the absolute path of my Java web application deployed on Heroku? is there any command to do this?
Mohamed's user avatar
  • 23
0 votes
1 answer
161 views

I know the title is a bit vague, so let me explain my explanation in more detail: I have a Java application I want to access the directory of my application on the clients computer, to store text-...
Adam Jacksson's user avatar
0 votes
1 answer
149 views

I have a java program and I want it to be able to print out its location on the computer. For example, if I were to place the program in the Downloads folder, and run it, it would print out the path ...
Bob the Bob's user avatar
1 vote
0 answers
108 views

I'm Making my first step going from C# to JAVA and have plenty of stuff that I dont get .. :( I was searching for a way to get current directory in JAVA and found this answer(one of many one ) : ...
LordTitiKaka's user avatar
  • 2,156
0 votes
0 answers
74 views

I am trying to build a simple client server application in which the server should return the working directory. I am very beginner in Java networking and at the moment I only know how to send a ...
Riyana's user avatar
  • 241
0 votes
0 answers
64 views

I get this error when trying to run my command-line application which reads data from a given csv file. The filename is "data.csv" and should not be hardcoded. Here is my code: Map<...
martin4o2864's user avatar
-1 votes
1 answer
98 views

Edit: I have figured out a solution to this problem and it is very similar to was MS90 commented. Since my working directory is "ATM project", then java will only be able to notice relative path's I ...
Jonathan's user avatar
  • 284
0 votes
0 answers
49 views

I want to read in a text file but I want to actually be able to open up the directory(wherever the program is ran) and navigate to wherever I want to a .txt file. How can I do this in java?
David 's user avatar
  • 45
419 votes
18 answers
848k views

I am trying to read a text file which is set in CLASSPATH system variable. Not a user variable. I am trying to get input stream to the file as below: Place the directory of file (D:\myDir) in ...
Chaitanya MSV's user avatar
123 votes
8 answers
393k views

Let's say I have my main class in C:\Users\Justian\Documents\. How can I get my program to show that it's in C:\Users\Justian\Documents? Hard-Coding is not an option- it needs to be adaptable if it's ...
Justian Meyer's user avatar
66 votes
9 answers
100k views

I want to copy a file from a jar. The file that I am copying is going to be copied outside the working directory. I have done some tests and all methods I try end up with 0 byte files. EDIT: I want ...
jtl999's user avatar
  • 1,175

15 30 50 per page
1
2 3 4 5
8