I'm new in java and Ubuntu. I want to know how can i write the right path of specific file in code as i got exception like that
/home/me/javaException in thread "main" java.io.FileNotFoundException:
home/me/java/config.properites (No such file or directory)
Here is my code:
public static void main(String[] args) {
Properties prop = new Properties();
String queryFile = null;
FileOutputStream fos = null;
try {
// load a properties file
FileInputStream finputstream = new FileInputStream("config.properties");
In ubuntu or any linux os your home folder is available in 'home/< username >'. You can check this from terminal or in gui. You can try some thing like,
File file = new File("/home/<your user name>/file.txt");
file.createNewFile();
FileWriter fw = new FileWriter(file.getAbsoluteFile());
BufferedWriter bw = new BufferedWriter(fw);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With