Problem opening a file from a command line executed program with args

I have to run my program from the command prompt like this:
c:\ java Parser template.txt keyvalue.dat output.txt
I figured out how to read the args in, and I know they are being assigned to the proper variables. My template.txt, etc are in the same directory that I am in when I run the program. They are also all lowercase, just like the command.
The only error it throws is the one that I coded (Error opening file template.txt) I would make my message better if I knew what the problem was!!!!
Any ideas (either for what I'm missing or how to improve my error handling) :\
Jen

After catching the exception, call the printStackTrace() to have it print out the error it caught, as well as the file and line number it occured on...

Similar Messages

  • Compress/zip files from the command line in Windows 7?

    In Windows 7 is there a native way to compress or zip files from the command line?  I'd like to do it without installing any third-party utilities such as 7Zip.

    I fully agree that Compact is not the answer. There are additional concerns with the Compact command. It enables disk compression which is a total no-no. Very bad! It makes your computer very slow and is quite difficult to undo. The only time anyone should
    use this command is when they're removing disk compression because someone turned it on to save space.  Turning this off has to be done by booting into the recovery console, if my memory serves me correctly, and it's a real nuisance.  So
    definitely no to the Compact command.
    If you wanted to compress files before sending them to another drive, or over a network, or by email, then Compact wouldn't actually help at all because the files have to get uncompressed whenever they're accessed, especially before sending them anywhere. 
    When I say accessed, I mean that just looking at a file triggers the OS to decompress it in the background and present you with an uncompressed version of it then letting you change it and recompressing it again for storage every single time you access the
    file, which is why your machine gets slower.  If you have folders or files that have blue text instead of black, then you've probably already made this mistake.
    I would also like to know if there is a built-in command for zipping files/directories, or, if there isn't such a thing built into Windows, then I would like to know if this is feature is accessible through Visual Studio, which would be just as good as having
    a command-line program for those of us that do a bit of programming.
    If anyone knows if MS provides such a feature, either by command-line or through an API, then I'd love to hear about it.  Good luck to those of you that have disk compression turn on.

  • Running jar files from the command line

    I have always felt it would be useful to run a jar file from th command line in EXACTLY the same way as an EXE. On some systems, typing MYAPP.JAR will run the app, but doesn't output and command line data, so it only works for GUI apps. I've come up with a tiny C program that runs java -jar xxxx.jar for you.
    #include <stdio.h>
    #include <string.h>
    #include <process.h>
    void main(int argc,char *argv[])
         char cmd[1024];
         strcpy(cmd,"java -jar ");
         strcat(cmd,argv[0]);
         strcat(cmd,".jar");
         for(int arg=1;arg<argc;arg++)
              strcat(cmd," ");
              strcat(cmd,argv[arg]);
         system(cmd);
    }Simply compile this to an exe, rename the exe to the name of your jar file and put it in the same directory. Then just type 'MyJarFile' (no jar extension) and it should run. It passes all command live args as well. Comments ?

    Here's a better version. The JAR and the EXE can be anywhere in the PATH:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <process.h>
    void main(int argc,char *argv[])
         char jar[1024];
         char cmd[1024];
         strcpy(cmd,argv[0]);
         strcat(cmd,".jar");
         _searchenv(cmd,"PATH",jar);
         strcpy(cmd,"java -jar ");
         strcat(cmd,jar);
         for(int arg=1;arg<argc;arg++)
              strcat(cmd," ");
              strcat(cmd,argv[arg]);
         system(cmd);
    }

  • Problem opening pdf file from an app built by Flash Builder 4.5

    problem opening pdf file from an app built by Flash Builder 4.5

    The iPad and iPhone have NEVER supported Flash and never will. In fact, Adobe is no longer distributing Flash builds to mobile devices.
    Time to move on...

  • Get the absolute path and filename of the file from the command line

    Hi,
    when we run the class we give the command
    java <filename>
    How can I capture the filename given above and get its absolute path inside the
    public static void main(String [] args){}
    args[0] gives me the command line argument after the filename. How do I capture the filename itself from the command line argument and also get that files absolute path
    Thanks

    I don't know of any way to capture the java command input, but there are ways to find out where the application is being run from. (the "absolute path")
    http://forum.java.sun.com/thread.jsp?forum=31&thread=335394

  • Run javascript (not in a jsx file) from the command line extendscript

    Hi all,
    I was wondering if anyone knew how to run javascript from the command line in Extendscript (meaning Extendscript would be the target application). I know about the -run command line flag in which allows you to run a .jsx script from the command line but what I'm looking for similar syntax to run a script directly without needing to put it in a file. For example I have tried (obviously unsuccessfully):
    C:\Program Files (x86)\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe -run "alert('Hello World');"
    Thanks!

    You might be looking for something like this: javascript - Is it possible to execute JSX scripts from outside ExtendScript? - Stack Overflow
    Although that one is about executing JSX files, the solutions given (Applescript as well as COM/VBScript) can be adapted to simply run a javascript code snippet rather than JSX file because the solutions simply call the Adobe app's Applescript/COM API to "execute javascript" (actually execute ExtendScript technically), and in the solution, they using includes to pull in the JSX file. You'd simply replace the include with actual javascript code snippet inserted in.
    Though this would then require you to run a VBScript, Applescript, or other script (that calls the COM/Applescript API) rather than the ESTK command line option.

  • Problem opening Illustrator files from Bridge

    I recently installed cs5.5 and can no longer open my Illustrator files from within Bridge.  When I double click on the file in Bridge, it switches to Illustrator and the hour glass appears for about 5-10 seconds before switching back to the selector tool, but the file never opens???  The only way I can open Illustrator files now, is to do the File>Open command within Illustrator. 
    I'm hesitant to reinstall CS5.5 because it took so long the first time. 
    Any suggestions??
    Thanks
    Paul

    It only seems to affect ai files.  I am able to open psd files from Bridge.
    I just discovered that I am also unable to "place" ai files in InDesign.  The same thing happens - I go to File>Place, find the ai file, double click the ai file, the hour glass appears for a brief moment then disappears, but the file doesn't get placed.
    Thanks for any suggestions.
    Paul

  • Problems opening pdf-files from KM of portal

    Hi,
    we store documents in our portal in KM. When I use pdf-files that where not saved with Office2007 tools I get the problem, that I can open the file once. If I open it the second time I get the error message "file doesn't start with "%PDF-". and the file will not be opend. If I delete the temporary files in the internet explorer, the file can be opended, again.
    If I open the file directly in the internet explorer I don't have those problems, so it seems, that the portal uses a different viewer than the internet explorer itself. 
    Has anyone an idea how to solve this problem?
    Regards
    Ulrike

    Ulrike,
    I think this is a known issue.
    Affected versions:
    o KMC SAP NetWeaver 7.0 (formerly named 2004s) SP 14
    o KMC SAP NetWeaver 7.0 (formerly named 2004s) SP 15
    If you have the above KMC and SP Versions then you need to follow the below SAP note:
    Note 1146711 - Problem opening PDF files.
    Have you checked the belowSAP Note?
    Note 954627 - Issues with opening/displaying PDF files from KM
    Regards,
    Karthick Eswaran

  • Problems opening PDF files from Websites

    I just had the contents of my (dying) ibook transferred onto my emac. The tech created a new user/desktop on the emac. Now, when I try to open PDF files from a website, I get a window saying this:
    "Downloading - users/myname/desktop/xxxxx.pdf could not be saved because an unknown error occurred. Try saving to a different location."
    Points to note: 1) The "xxxxx.pdf" part of the above message changes each time I try to open a pdf document, even the same one, and it does not show the real name of the document (e.g. CollegeApplication.pdf)
    2) this never happened on my laptop;
    3) the settings are set in Firefox to download pdf's to my desktop;
    4) I have the latest version of Adobe Acrobat, which I already tried opening before downloading.
    Any ideas? Thank you!

    Will the new account save to a different location?
    Is the "myname" that appears in the error message that of the new account or of the old one?
    Following up on Frank's tip about file permissions, is it possible that the GID of the new user account conflicts with the existing? The existing admin user was likely GID = 501 on both Macs, and depending on how the laptop's data was transferred, the internal ownership of the transferred files still points to 502 rather than say 502.
    have you tried the old standby of running Disk Utility's Repair Permissions on the hard drive?

  • Downloaded adobe photoshop elements 10 editor from Mac app store onto my mac book pro, set i photo preferences to APE 10 Editor, but can not open any files from my library, error saying " program error". What else do I need to do?

    Have downloaded Adobe Photoshop Elements 10 Editor from the Mac App Store onto my Mac Book Pro, set i photo preferences to Adobe PSE 10 editor, but when I try to open a file from my photo library, the following message appears: "could not complete your request because of a program error". What can I do to resolve this issue?

    Hi..
    Post your topic in the iPhoto community here. That way you can get feedback from iPhoto users.
    This community is primairly for issues with the App Store.

  • How do I create an AppleDouble "dot-underscore" file from the command line?

    We're going through a process of migrating NetWare shares to Windows shares (without File Services for Macintosh) where I work. One concern is that the NetWare shares are shared as AFP volumes to the Macs. All the finder info and metadata for the files is thus stored natively and invisible to all the servers involved in the migration. If the Novel migrator or robocopy copy the files, resource forks and metadata are lost.
    The procedure I've provided the migration team involves making a UFS disk image, identifying files on the NetWare share that have Mac resource forks or metadata, copying the files from NetWare to the image one-by-one (whereby the OS creates the AppleDouble dot-underscore files), and then copying the dot-underscore files back to the NetWare share so that when either migration tool is used, the files correctly appear on the Windows shares in AppleDouble form with forks and metadata intact. This works reliably enough, but it involves a HUGE amount of network activity, and there's issues with making sure that the permissions are correct in the process.
    Is there a way to directly produce the AppleDouble dot-underscore file from a file on an AFP share. Things like SplitForks, RezWhack, etc. don't work on shares. I cannot find any command-line utility, AppleScript extension, Automator action, etc. to do it.

    Thank you. I am aware of that, cpio as well. The problem is that I don't want to have to copy the files, just create the dot-underscore file. For various reasons, we still need to use the Windows-based migration tools to migrate the files. So what I want is something that can read the metadata and resource fork WITHOUT making a copy of the file to produce the dot-underscore file. The solution I
    currently have for them works like tar (without the extra step of storing things in the archive or requirement of using OS X tar to unpack it).

  • Unable to generate jra recorder file from java command line.

    Following the instructions at
    http://e-docs.bea.com/wljrockit/docs142/userguide/jra.html#1056021 I'm using
    the following command line to launch my application:
    java -cp bin -Xnoclassgc -Djrockit.lockprofiling -XXjra MyClass
    I'm getting a file lprofile.txt, but no XML file containing the jra
    recording.
    Is the documentation correct?
    jrockit version: BEA WebLogic JRockit(TM) 1.4.2_04 JVM
    Windows XP IA32
    Michael Giroux

    Helena,
    Thanks
    You need to give some parameters to the -XXjra commandNow that I re-read the doc, I see that delay is required. All other
    parameters are optional. I did not notice that the delay has no default
    value. Maybe you could add that to the documentation to make it more clear
    that -XXjra:delay=xx is a minimum requirement.
    Michael
    "Helena Åberg Östlund" <[email protected]> wrote in message
    news:40ff72b4$1@mail...
    Michael,
    You need to give some parameters to the -XXjra command or JRockit will not
    know when to start the recording etc. Parameters are separated by : as
    described in the documentation so the docs are correct. Some valid
    parameters would be for example:
    -XXjra:delay=45,recordingtime=120,filename=myrecording.xml
    which means "start a recording of length 120 seconds in 45 seconds after
    JVM startup. Write the data to the file myrecording.xml".
    I hope this helps.
    /Helena
    Michael Giroux wrote:
    Following the instructions at
    http://e-docs.bea.com/wljrockit/docs142/userguide/jra.html#1056021 I'm
    using the following command line to launch my application:
    java -cp bin -Xnoclassgc -Djrockit.lockprofiling -XXjra MyClass
    I'm getting a file lprofile.txt, but no XML file containing the jra
    recording.
    Is the documentation correct?
    jrockit version: BEA WebLogic JRockit(TM) 1.4.2_04 JVM
    Windows XP IA32
    Michael Giroux

  • I cannot open any .doc files on Firefox from any source such as yahoo mail, blackboard, and UW Catalyst, while I have no problem opening .docx files from the same sites. When then happens, I have to switch to explorer and it's really annoying.

    Cannot open Microsoft Word .doc files from any website (.docx are ok)

    That is a legitimate Mozilla newsletter. As it says in the email:
    You're receiving this email because you subscribed to receive email newsletters and information from Mozilla. If you do not wish to receive these newsletters, please click the Unsubscribe link below.
    Unsubscribe https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/
    Modify your preferences https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/ "

  • Problem open pdf files from windows xp or W2K3(Not from Windows 7)

    Hi,
    i have some pdf files in a shared folder(W2K3).These are in other subfolders.Some of them cannot be opened .Right click options are limited (photo below).The weird thing is that happens when you try to open the files either from the server or a windows xp machine.From Windows 7 are opening normally.I thought of being an issue with file directory .Any idea ?
    Thanks

    I had to install adobe reader, but   PDF's used to display just fine with IE, any idea what happened ?
    Windows 8.1 pro.
    thx
    lee

  • I would like to open an .htm file from the command line using firefox. Firefox responds by trying to open a URL (adding WWW to front of file name)

    firefox is located on unix box and I would like to use it to open report generated. After script creats report I would like to call firefox to read report. "firefox report.htm"

    I have solved this problem. All I needed was to follow firefox with the filename

Maybe you are looking for

  • PDF showing in gray scale when it is color in other readers

    I have created a stack of PFD files from sets JPG or TIF images. An example can be seen at http://www.awm.gov.au/collection/records/awm78/1/awm78-1-6.pdf When we open these with Acrobat Reader 10.0.0 the pages are in grey scale. When opened with any

  • How to Force Landscape View with EAGLView

    I thought the crash lander app was a perfect template for me. Everything is working great except now I realize my game will really work better in landscape mode than portrait. I can't get it to work no matter what I try I've read through the many pos

  • How to publish iWeb online but not through iCloud but someone else?

    How to publish iWeb online but not through iCloud but someone else? Mybe Google or woodpress,  Or publish iWeb online with iCloud WITHOUT upgrading Lion?

  • SAP Certification query

    Hello Everybody i m planning to certification in SAP. i did my M tech with Specialization in SAP ABAP. i have 9 month of experience in SAP ABAP as an intern. there are some query regarding certification : 1.  As i already have some experience in ABAP

  • NO CONTENT AWARE BUTTON APPEARS???

    .....after I select the healing tool......there's nothing on my menu bar to indicate that content aware is there.  I figured out I could go to "fill"....then chose the content aware option, but, I can't for the life of me figure out why it doesn't ap