Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:49:39+00:00 2026-06-10T12:49:39+00:00

Note : The actual error from Java/Closure Compiler came from the missing t in

  • 0

Note: The actual error from Java/Closure Compiler came from the missing t in –js-outputfile!

I have this PowerShell script:

cls
$jsFiles = @();

Get-ChildItem | Where {$_.PsIsContainer} | Foreach {
    $dir = $_.FullName;
    $jsFile = $dir + "\" + $_.Name + ".js";
    if (Test-Path ($jsFile)) {
        $jsFiles += $jsFile;
    }
}

$wd = [System.IO.Directory]::GetCurrentDirectory();

# Build Closure Compiler command line call
$cmd = @("-jar $wd\..\ClosureCompiler\compiler.jar");

Foreach ($file in $jsFiles) {
    # Both insert a newline!

    $cmd += "--js $file";
    #$cmd = "$cmd --js $file";
}


$cmd = "$cmd --js_ouput_file $wd\all.js";

Invoke-Expression "java.exe $cmd"

The problem is that newlines are inserted on each += or $cmd = "$cmd str" call!

Echoargs gives me this output:

Arg 0 is <-jar>
Arg 1 is <S:\ome\Path\compiler.jar>
Arg 2 is <--js>
Arg 3 is <S:\ome\Path\script1.js>
Arg 4 is <--js>
Arg 5 is <S:\ome\Path\script2.js>
...
Arg 98 is <--js_ouput_file>
Arg 99 is <S:\ome\Path\all.js>

(Possibly) therefore, I get some errors from java.exe:

java.exe : "--js_ouput_file" is not a valid option
At line:1 char:1
+ java.exe -jar ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ("--js_ouput_file" is not a valid option:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:49:40+00:00Added an answer on June 10, 2026 at 12:49 pm

    Try to rewrite to much simple version:

    cls
    
    $wd = [System.IO.Directory]::GetCurrentDirectory();
    
    # Build Closure Compiler command line call
    $cmd = "-jar $wd\..\ClosureCompiler\compiler.jar";
    
    $arrayOfJs = Get-ChildItem -Recurse -Include "*.js" | % { "--js $_.FullName" };
    
    $cmd += [string]::Join(" ", $arrayOfJs);
    
    Invoke-Expression "java $cmd --js_ouput_file $wd\all.js"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note, this isn't my code, or the actual code in the form. This is
NOTE: This is a followup to my question here. I have a program that
NOTE: I have read Routing From the Inside Out AND the Engine Yard blog
Note: The title of this was changed to better reflect the actual problem. I've
In this simplified version of my actual problem, I have two tables: User and
Note, this is not a duplicate of .prop() vs .attr() ; that question refers
(Note: This is not a question about what is the best way with code
Note: Not sure if this is the right stack, please tell if I should
NOTE: This is an old question and the answers here no longer works (since
I think this is a general Java question, but it does involve some Android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.