Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
-My code is used to create and Update the environment path using java with Netbeans and cmd prompt. That is working fine in my output console, BUt when i convert it into jar file that is not working properly. what should i do to work on windows 10. Because it's Working Fine in Windows8 & WIndows7.. Thanks in Advance...
Runtime rt = Runtime.getRuntime();
String CreoPath_textfield = Textfield.getText();
try {
rt.exec(new String[]{"CMD.exe", "/C", "setx CREO_PATH \""+CreoPath_textfield+""});
} catch (IOException ex) {
Logger.getLogger(Environment_set.class.getName()).log(Level.SEVERE, null, ex);
}
if(CreoPath_textfield.equals(""))
{
JOptionPane.showMessageDialog(null, "<html><b><font color=red>"+"Please enter Your Creo Path" + "</font></b></html>","Error", JOptionPane.ERROR_MESSAGE);
}
else{
setVisible(false);
}