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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:06:56+00:00 2026-06-08T17:06:56+00:00

I am facing the following problem: I am writing a java-application in Eclipse. Inside

  • 0

I am facing the following problem:

I am writing a java-application in Eclipse. Inside my application I want to start a cmd command:

C:/Users/User1/Content-Integration Testing Framework/JDBC Connector/bin/connect -h

The command ‘connect -h’ is a an enterprise internal application which works fine.
If I would use a comand line a would have to chance my current directory like that:

cd C:/Users/User1/Content-Integration Testing Framework/JDBC Connector/bin/

and afterwards I would just type connect -h
This works great. But I am not really shure how to execute this command within a java application.

Here they tell me how to run a cmd inside a java application:
How to use "cd" command using Java runtime?

But if I do that:

Runtime.getRuntime().exec("'C:/Users/User1/Content-Integration Testing Framework/JDBC Connector/bin/connect' -h");

Eclipse tells me:

java.io.IOException: Cannot run program "'C:/Users/User1/Content-Integration": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
    at java.lang.ProcessBuilder.start(Unknown Source)

It cuts my command at “Content-Integration”.

can someone help me please?

  • 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-08T17:06:57+00:00Added an answer on June 8, 2026 at 5:06 pm

    You should use the version of exec() that takes multiple args via a String array.

    Runtime.exec(String s) will split your string using a tokenizer (this is why quoting the string won’t work, and why you see the behaviour you do). If you resolve the executable and arguments yourself, and pass each as an array element in the above e.g.

    String[] args = new String[]{"executable", "arg1", "arg2"};
    Runtime.getRuntime().exec(args); // don't forget to collect stdout/err etc.
    

    then you will bypass Runtime.exec(String s)‘s splitting behaviour.

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

Sidebar

Related Questions

I am facing the following problem: I use Eclipse for my Java projects and
Im facing the following problem: I want to integrate the mercurial hash into my
I'm facing the following problem : my app has to load some web-content and
I'm currently facing new problem with operators. Using following code, I want to make
I am facing the following problem: I have a HTML document where I want
I am facing the following problem: I want to add dynamically a mobile site
I'm learning Haskell now and I'm facing the following problem: I want to rewrite
I am writing a very basic web spider in java.I am facing one problem,
Currently we are facing following Problem in our Application: Around 40 % of the
I'm facing with the following problem: I created application where user can keep his

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.