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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:45:52+00:00 2026-06-15T16:45:52+00:00

i got two questions. Where is the directory the Method Runtime.getRuntime().exec() gets its resources

  • 0

i got two questions.
Where is the directory the Method Runtime.getRuntime().exec() gets its resources from?

if i am calling Runtime.getRuntime().exec("notepad.exe"), why does it start the windows editor? Where does java gets the .exe source from?

based on this question, i have to let the user choose, if he wants to open a file in an editor, which editors he prefers, and wants to use. He only writes in something like notepad.exe or ultraedit.exe and the choosen file will be opened in the editor written down here. At the moment, i am opening a file with this Method

public void open(String path) {
    try {
        if(new File(path).exists())
            Runtime.getRuntime().exec("notepad.exe " + path);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

So as you can see every file will be opened within the notepad. But i need to have something like this :

public void open(String program, String path) {
    try {
        if(new File(path).exists())
            Runtime.getRuntime().exec(program + " " + path);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

So is there any possibility to open txt files in different editors, by just calling their
.exe file?

  • 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-15T16:45:53+00:00Added an answer on June 15, 2026 at 4:45 pm
    Where does java gets the .exe source from?
    

    Its not about java. check the PATH environment variables in you Operating systems. It has the path for all the exe files.
    Try this

    1) open cmd

    2) type c:\> echo %PATH%

    the second will tell you the values of PATH variable

    So is there any possibility to open txt files in different editors, by just calling their .exe file?
    

    yes edit the PATH variable to include the path of you other editor’s exe file ( use semicolon and then append the path to environment don’t replace the existing string ), and the java program remains the same

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

Sidebar

Related Questions

I've got two questions (of which at least one is regarding RTTI in D2010
I've got some questions about two ways to save settings in the web.config. Appsettings
I've got two questions/issues regarding the AspxPivotGrid . When I use the customization window
Got two questions: How can i intgrate a php script to a html document
I've got two questions about LÖVE . Can I sell what I make in
I've got question to you. I have got two project in PHP that uses
Yet another PHP question. I've got two arrays: one string-based and the other numeric.
I just had a question about aligning two expand-collapse boxes and got an answer
I got two data storages in my Windows Azure account. One is for the
I got two tables: comments and commentLikes in the same query i count the

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.