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 8484043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:16:23+00:00 2026-06-10T20:16:23+00:00

In a project, I’m trying to set up an automated build system for Apache

  • 0

In a project, I’m trying to set up an automated build system for Apache Karaf (there are several commands I need to run in Karaf to set up a working environment on a fresh install). Karaf contains a batch/script file that sets several parameters, and then calls the actual Java program. Essentially, I’d like to be able to do something like:

java MyProgramClass.class < commandTextFile.txt

But when I try this it doesn’t do anything. My goal is to simply copy the karaf.bat file, modify it slightly (as below) to make a “karaf-install.bat” that I can just run. The part I’ve modified of karaf.bat is below, and all I’ve done is add < "C:\commandFile.txt at the end (the following is all on one line, broken for readability):

"%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" 
  -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" 
  -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext"
  -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" 
  -Dkaraf.base="%KARAF_BASE%" -Dkaraf.data="%KARAF_DATA%" 
  -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" 
  %KARAF_OPTS% %MAIN% %ARGS% < "C:\commandFile.txt"

However, Karaf shows nothing. It just runs as if I executed it as normal; my commands are not executed. Is there a way to redirect INTO a java program from the console? Am I doing it way wrong?

For what it’s worth, this will eventually be done on both Windows and OS X, but I’m focusing on Windows at the moment.

Update: turns out that this seems to work for me on OS X (Karaf struggles (by saying “Command not found: “), but I think it’s because it’s getting the commands before it’s initialized everything), but Windows is still doesn’t even get the commands. I’ll poke around more.

  • 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-10T20:16:25+00:00Added an answer on June 10, 2026 at 8:16 pm

    I’m just going to write this issue off as Karaf weirdness, seeing as it works on OS X. I was able to work around it by using the client program that comes with Karaf by doing (on OS X in a .sh file):

    "$KARAF/bin/client" "karaf_command_here"
    

    or (on Windows in a .bat file)

    call "%KARAF%\bin\client.bat" "karaf_command_here"
    

    And instead of having a list of commands to pipe into Karaf, I just made the list of commands a shell/batch script file that would call Karaf’s client for each command. Not as pretty as I’d have liked it, but it got the job done.

    (Note you need to start Karaf before using the client with start (and close it with stop)).

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

Sidebar

Related Questions

My project is ARC enabled (the build settings have Objective-C Reference Counting set to
Project Requirements: I need to build a web service that will receive chunks of
Project doesn't need any javascript libraries such as jQuery, Dojo, Prototype so there is
Project layout: /project_a /shared /project_b /shared /shared project_a and project_b both need to contain
The project that I am working on (Node.js) implies lots of operations with the
My project have no visible error but when i try to run it gives
Project I'm working on uses jQuery. I have a series of Ajax calls being
project is written on php. There is timestamp field in mysql it updates automatically.
Project file here if you want to download: http://files.me.com/knyck2/918odc So I am working on
Current project is an Mvc4 application, I had Ioc working and recently it just

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.