• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Getting output to work

Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 24204
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
There's a way to do it better - find it. -Edison. A better tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic