• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Getting output to work

 
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
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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!