How to run external jar file with parameters

  • Martin

    Martin - 2013-01-14


    Noob question here…

    I'm trying to run an external jar file (shrinksafe) to compress a javascript file with the following command:

    java -jar C:\dojo\dojo-1.4.3-src\util\shrinksafe\shrinksafe.jar $(FILE_NAME) > $(CURRENT_DIRECTORY)\$(NAME_PART).ss

    The console is reporting js: Couldn't open file: ">"
    The console is reporting js: Couldn't open file: "myFile.js"

    The console reports the correct command (I've tried it in a command window), but it seems NPPExec is using the arguments itself.

    How do I ensure these are passed to the shrinksafe jar/exe as parameters?


  • DV

    DV - 2013-01-14

    The stupid forum just ate my previous reply here, so I'm very angry now… 
    So, first of all, refer to NppExec Manual, sections 1.3 and 3.1 - and read them carefully! Then proceed to 4.4. 
    After that, you'll know to use "cmd /c " before each command that supposes to use some features of command interpreter such as redirection. 
    Finally, don't forget to enclose file paths and names in double-quotes since file paths and names can contain spaces.

  • Martin

    Martin - 2013-01-14

    Found that I can execute it using cmd.

    cmd /c java -jar C:\dojo\dojo-1.4.3-src\util\shrinksafe\shrinksafe.jar $(FILE_NAME) > $(CURRENT_DIRECTORY)\$(NAME_PART).ss

  • Martin

    Martin - 2013-01-14

    Thanks dv__

    Just seen your response when I replied.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks