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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:01:19+00:00 2026-05-27T02:01:19+00:00

Can anyone tell me why this c# console command not running on Java? I’ve

  • 0

Can anyone tell me why this c# console command not running on Java?

I’ve made a C# console program as given below:

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace face
{
    class Program
    {
        public static void Main(string[] args)
        {
            String path = args[0];
            byte[] imageBytes = File.ReadAllBytes(path);
            MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);
            // Convert byte[] to Image
            ms.Write(imageBytes, 0, imageBytes.Length);
            Image image = Image.FromStream(ms, true);
            Bitmap S1 = new Bitmap(image);
            Console.WriteLine(S1.GetPixel(2, 10));
        }
    }
}

When I run Program.exe image.jpg, I get:

Color [A=255, R=128, G=32, B=128]

Then I created a simple Java application to run the Program.exe executable:

class project 
{   
 public static void main(String[] args)
 {
    String comman="C:\\WINXP\\system32\\Program.exe Sunset.jpg";
    try 
    {
     Process process = Runtime.getRuntime().exec(comman);
     System.out.println(process.getOutputStream());
    } catch (Exception e) 
         {e.printStackTrace(System.err);}
 }
}

When I try to run the Java application, I get the following error:

Program.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

  • 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-27T02:01:20+00:00Added an answer on May 27, 2026 at 2:01 am

    You probably want to change

    String comman = "C:\\WINXP\\system32\\Program.exe Sunset.jpg";
    

    to

    String[] comman = { "C:\\WINXP\\system32\\Program.exe", "Sunset.jpg" };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can anyone tell me why this does not work Excel.Worksheet ws_res = (Excel.Worksheet) wb.Worksheets.Add(mis,
Can anyone tell me what exactly does this Java code do? SecureRandom random =
Can anyone tell me how do this? They are already integers, so I'm not
Can anyone tell me why this crashes my program? It's suppose to make it
can anyone tell me what is wrong with this code: CC = C:\Program Files\Microsoft
Can anyone tell how this check this link here (swing) effect is given in
Can anyone please tell me what I should be using and why this method
Can anyone tell me why this bash script works if I cut and paste
Can anyone tell me why this would generate a syntax error in Safari and
can anyone tell me why this code don't work: $q = $_GET['q']; // Load

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.