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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:34:22+00:00 2026-06-03T01:34:22+00:00

Background I have an old applet that I want to revive. All functionality works

  • 0

Background

I have an old applet that I want to revive. All functionality works in Windows XP. However, in Windows 7 it doesn’t work to open a file in its native application (part of code below). Nothing happens, no error or anything similar. I am using Java version 1.5.0 (J2SE 5.0), thus Desktop.getDesktop(); will not work!

Code

public void start(String sFileName, String sDir, ctgraphics gGfx) {
    String command = '"' + sDir + sFileName + '"';
    Runtime myRuntime = Runtime.getRuntime();
    try {
        myRuntime.exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + command);
        gGfx.setStatusText("File opened.");
        gGfx.drawStatusBar(1);
    } catch (IOException e) {

        System.out.println("Error " + e.getMessage());
    }

}

Question

Why doesn’t the above code work in Windows 7 and what do I need to do instead to be able to open a file in its native application (considering I am using Java v. 1.5) ?

.

Cheers.

  • 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-03T01:34:24+00:00Added an answer on June 3, 2026 at 1:34 am

    You may want to use the Desktop support, look at this link:

    Desktop.open

    You just create a File with the path of the file you want to open and then call Desktop.getDesktop().open(file).

    Before 1.5 desktop was a Library that then it made it into the standard JDK, you can consider using this option.

    Here you can find a tutorial:

    javadesktop tutorial for java one 2004

    Hope this helps

    And here is the project site:

    JDIC Project

    Here you can find the jars:

    Maven repo with jdic jars

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

Sidebar

Related Questions

Background I have a service that is connecting to Microsoft CRM 2011, and updating
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may
I have an old app which did many UI initialization work in viewDidLoad of
Background: I have a website that has been built with ASP.NET 2.0 and is
Background: We have a client/server application that uses a persistent connection to the server.
I have heard that old arcade side scrolling games used a specific programming hack
In my rails application, I have a background process runner, model name Worker, that
Background: I have to create a report that will be run regularly to send
First a little background: I have an Event model that has various event_type s.

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.