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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:01:09+00:00 2026-06-05T02:01:09+00:00

Recently I moved on a brand new machine 64-bit Windows 7. But when I

  • 0

Recently I moved on a brand new machine 64-bit Windows 7. But when I run this code, getting the incorrect OS name

String osName = System.getProperty("os.name");
System.out.println("OS Name = " + osName);

The output comes:

OS Name = Windows Vista

Any idea, what is wrong in my code or system?

Thanks in Advance.

  • 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-05T02:01:11+00:00Added an answer on June 5, 2026 at 2:01 am

    You might be using an older version of Java. As this was a known bug(bug_id=6819886) that has been fixed in the newer versions.
    Kindly read this for further details.


    A possible workaround for this in case you are not able to upgrade your java version:

    String osName = System.getProperty("os.name");
        if (osName.equals("Windows XP") || osName.equals("Windows Vista"))
        {
           //do something and remember to put in all the names in the above if list. I just added two for example,it will have to include all like Windows NT,ME,95,etc.
        }
        else
        {
            //the block that will be accessible for Windows 7
        }
        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently moved a friends blog onto his new web hosts but unfortunately the
I've recently moved from [Windows 2003-32 bit, IIS 6 .NET 2.0] to [Windows 2008-64
I recently moved my development to a Windows 7 machine, and am having all
I recently moved website to a new host. The server setup is very similar.
I recently moved my asp.net appliaction from windows 2003 / IIS 6 to windows
We recently moved our Windows CE application to the SD Card. Since then the
I recently moved my main website into a new folder: The websites was in
We recently moved from SVN to Git, but there's a single legacy branch that
I recently moved my development environment to my local machine (mac), and setup an
I recently moved my projects to a new mac, along with a newer version

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.