read registry compare value to if statement
<p>I have a working code for reading the registry, my problem is the part where I read the registry and I want to compare some if statements to eventually do stuff depending on the answer. I checked the value, it outputs Windows 7 Professional as the value, my if statement disagrees.</p>

<p>My registry code is from <a href="http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java">here</a></p>

<pre><code>public class Regtest {

    public static void main(String[] args) { 
    String value = null;
    String os7 = "Windows 7 Professional";
    try {
        value = Registry.readString ( 
                Registry.HKEY_LOCAL_MACHINE,                             //HKEY 
               "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",           //Key 
               "ProductName");

        if(value == os7 ){
            System.out.println("Windows Distribution = " + value);
        }else{
            if(value != os7 ){
                System.out.println("Windows Distribution = Wrong OS");  
            }
        }
    } catch (IllegalArgumentException e) {
                e.printStackTrace();
    } catch (IllegalAccessException e) {
                e.printStackTrace();
    } catch (InvocationTargetException e) {
                e.printStackTrace();
            }                                              
        }  
    }
</code></pre>
