• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting output to work  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following program that's meant to convert Unix text files to Windows format:



I'm running it in Eclipse and when I run it, there is no output file created with the arguments "question1/unixfile.txt question1/windowsfile.txt". I have the unixfile.txt in my question1 package and it's supposed to generate the windowsfile.txt.

I'm not familiar with arguments in Eclipse so maybe I'm entering them wrong or I might be missing a command. Help please?
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you're running a program from inside an IDE, you have to be careful, because most of the time the program's current working directory is the same as the IDE's, and it's not the same as the output directory where your compiled class files (and presumably data files) are put. That's almost certainly why you're having trouble.

One straightforward way to deal with this would be to use absolute pathnames as arguments (i.e., "/home/adam/question1/unixfile.txt")). But the best thing would probably be to use the "Arguments" tab of the Eclipse run configuration dialog, which has an option at the bottom of the page to set the program's working directory. Just make sure you set it to something that jives with your arguments, and everything should work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!