Question
i have created a Java program in Eclipse, it manipulates data and outputs a new file.txt when i run it in Eclipse it works perfectly,
i have created a Java program in Eclipse, it manipulates data and outputs a new file.txt
when i run it in Eclipse it works perfectly, however when i get the executable .jar file and run it using "java -jar filename.jar" in windows cmd
it works perfectly, but it doesn't output the file that it does inEclipse.
i'm lost here i don't know what's the problem, i tried using apache fileutile, file writer, nothing works,
i even let eclipse get the absolutepath() but still to no avail.
here's the code that creates the file:
File f1= new File(name);
String filePath = f1.getAbsolutePath();
String fileName=filePath.replace(extension, "");
File file = new File(fileName+"_new.txt");
FileWriter writer1 = new FileWriter(file);
try { writer1.write(read.disasembler); writer1.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }
plese help
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started