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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:36:11+00:00 2026-06-03T03:36:11+00:00

How do I start a java application from a C# application? I’m working on

  • 0

How do I start a java application from a C# application?

I’m working on a minecraft launcher. Is there a general method to start any jar from a C# application?

  • 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-03T03:36:12+00:00Added an answer on June 3, 2026 at 3:36 am

    You could start the jar file as a new process:

    string appData = Environment.GetEnvironmentVariable("APPDATA");
    
    Process.Start(@"java",
      @"-Xms512m -Xmx1024m -cp """ + appData + @"\.minecraft\bin\*"" -Djava.library.path=""" + appData + @"\.minecraft\bin\natives"" net.minecraft.client.Minecraft");
    

    This assumes java is in your PATH (which happens by default when java is installed). If not, use the absolute path to java.

    This is starting the game directly – you can use the minecraft launcher if the user told you where they put it. On windows, that’s an exe, so you can start it directly.

    Also, APPDATA is a window’s variable. For linux, the path is in $HOME, or ~/. Also, the params aren’t quite the same. Assuming your users will run your app with Mono for linux (or apple). I don’t have Mono handy to test the options for you, but you can use

    public static bool IsLinux
    {
        get
        {
            int p = (int) Environment.OSVersion.Platform;
            return (p == 4) || (p == 6) || (p == 128);
        }
    }
    

    To help you select the correct start path. The above code was found here. I note that the property in the sample above is called IsLinux, yet the quote from Mono docs says 6 is for Mac OS X. This leads me to believe the property should actually be called IsUnix (as apple fanatics continue to preach such is the case though apple is as much unix as windows is dos). I don’t have macware on hand to test this, I leave that to the student.

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

Sidebar

Related Questions

I am working with Java web start. After launching application with Java web start,
Typically, Java application runs with the start argument - path to .jar or .class
I'd like to start external third party application from my Java application. This external
I need do start the derby server from my java application using org.apache.derby.drda.NetworkServerControl class.
I'm trying to start Derby in Network server mode from my Java application with
The user wants to start the Java GUI application from Windows , with some
How can I start a Java application from within a C++ process? I don't
Is it possible to programmatically start an application from Java and then send commands
I want to execute a jar from my own java application. (it's impossible to
I use a batch to launch my java application like this start /min java

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.