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

  • Home
  • SEARCH
  • 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 6053621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:03:41+00:00 2026-05-23T08:03:41+00:00

I am making a build script as a batch file (don’t ask me why

  • 0

I am making a build script as a batch file (don’t ask me why or suggest alternatives. You won’t be helping). I have a variable called CLASSPATH that I use with the java compiler. CLASSPATH contains paths to numerous directories and jar files. In addition to those, I’d like to add every jar file in the .[some-long-path]\lib\ directory

It looks something like this:

SET /p dummy=%CLASSPATH%>classpath.tmp~<nul 
SET WAR_LIB_PATH=war\WEB-INF\lib
DIR %WAR_LIB_PATH% /B | findstr /L ".jar" > jars.tmp~
REM Have to put it into an external file
FOR /f %%j in (jars.tmp~) do (
    SET /p dummy=;%WAR_LIB_PATH%\%%j>>classpath.tmp~<nul 
)
SET /P CLASSPATH=<classpath.tmp~
ECHO %CLASSPATH%

This ALMOST works. There are just two problems:

  • Somehow a space appears between entries, which ruins the classpath.
  • It abruptly ends after 1024 characters.

Can someone help me with this?

  • 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-05-23T08:03:42+00:00Added an answer on May 23, 2026 at 8:03 am

    If you use java6, it’s enough to write dir/* to include all jars in the dir

    http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html

    For example, if directory foo contains
    a.jar and b.JAR, then the class path
    element foo/* is expanded to
    A.jar;b.JAR

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a build script where i create a text report file and output
i have to build some financial data report, and for making the calculation, there
Let's suppose I have a valid Ant build script which packs up and prepares
I have a gradle build script similar to: apply plugin: 'war' task genSources <<
I have two select elements. Making a choice on the first select will build
I'm making a program which the user build directories (not in windows, in my
I'm making a Django web-app which allows a user to build up a set
Anyone know how, when making GCC, to tell it not to build gcov? It's
Making my first steps with NHibernate, I'm trying to have it creating my Tables
In TFS 2008, I am trying to modify a build script (TFSBuild.proj). I get

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.