This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 25524
Collapse All | Expand All

(-)src/org/netbeans/installer/actions/WriteAction.java (-4 / +10 lines)
Lines 167-184 Link Here
167
    private void writeJDKHome(){
167
    private void writeJDKHome(){
168
        try {
168
        try {
169
            String file = productInstallLocation + File.separator + "bin" + File.separator + "ide.cfg"; //NOI18N
169
            String file = productInstallLocation + File.separator + "bin" + File.separator + "ide.cfg"; //NOI18N
170
            PrintWriter ps = new PrintWriter(new BufferedWriter(new FileWriter(file)));
170
            PrintWriter ps = new PrintWriter(new BufferedWriter(new FileWriter(file,true)));
171
            int jreIndex = javaHome.indexOf("jre");
171
            int jreIndex = javaHome.indexOf("jre"); //NOI18N
172
            if(jreIndex != -1){
172
            if(jreIndex != -1){
173
                jdkHome = javaHome.substring(0,javaHome.length()-4);
173
                jdkHome = javaHome.substring(0,javaHome.length()-4);
174
            }
174
            }
175
            //check if it is really jdk - not only jre
175
            //check if it is really jdk - not only jre
176
            File compiler = new File(jdkHome + separator+"bin"+separator+"javac");  //NOI18N
176
            File compiler = new File(jdkHome + separator+"bin"+separator+"javac");  //NOI18N
177
            if(compiler.exists()){
177
            if(compiler.exists()){
178
                ps.println("-jdkhome " + jdkHome + " -J-Xmx96m -J-Xms24m -J-Xverify:none" );    //NOI18N
178
                FileReader fr = new FileReader(file);
179
                String[] line = fileService.readAsciiFile(file);
180
                for(int i=0; i < line.length; i++){
181
                    if(line[i].indexOf("-jdkhome") != -1)   //NOI18N
182
                        return;
183
                }
184
                ps.println("-jdkhome " + jdkHome );    //NOI18N
179
                ps.close();
185
                ps.close();
180
            }
186
            }
181
        } catch (java.io.IOException e) {
187
        } catch (Exception e) {
182
            logEvent(this, Log.ERROR, e);
188
            logEvent(this, Log.ERROR, e);
183
        }
189
        }
184
    }
190
    }

Return to bug 25524