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 66960
Collapse All | Expand All

(-)core/arch/arch-core-launcher.xml (+16 lines)
Lines 680-685 Link Here
680
                </api>
680
                </api>
681
            </li>
681
            </li>
682
        </ul>
682
        </ul>
683
        
684
        <api name="JDKCheck" type="export" group="property" category="devel">
685
            The <q>JDK check</q> API is a special contract between the core/startup
686
            module and branded applications on top of it, that allows to perform
687
            a check for a special class to be available during execution of 
688
            NetBeans based application. If it is missing a warning dialog is shown
689
            and user can cancel the execution. The contract is based on 
690
            branding keys from 
691
            <a href="http://www.netbeans.org/source/browse/core/startup/src/org/netbeans/core/startup/Bundle.properties?rev=1">
692
            org/netbeans/core/startup/Bundle.properties</a> file:
693
            <ul>
694
                <li><code>JDK_CLASS_TO_CHECK</code> - shall contain the class to check for</li>
695
                <li><code>MSG_NEEDJDK_TITLE</code> - the title of the dialog</li>
696
                <li><code>MSG_NEEDJDK</code> - the text of the message</li>
697
           </ul>
698
        </api>
683
    </answer>
699
    </answer>
684
700
685
701
(-)core/startup/src/org/netbeans/core/startup/Bundle.properties (+16 lines)
Lines 177-179 Link Here
177
    This property cannot be changed while the IDE is running, so this attempt had no effect.
177
    This property cannot be changed while the IDE is running, so this attempt had no effect.
178
# {0} - JAR file name
178
# {0} - JAR file name
179
TEXT_patch=Module patch or custom extension: {0}
179
TEXT_patch=Module patch or custom extension: {0}
180
181
#
182
# Jdk check
183
#
184
185
# NOI18N - provide name of a class from JDK you wish to load to ensure that we really run on JDK
186
JDK_CLASS_TO_CHECK=null
187
# {0} - path to JRE
188
# {1} - messages 
189
MSG_NEEDJDK=It seems that your application is running on Java Runtime Environment\n \
190
    from directory {0}.\n \
191
    However in order to be fully functional it needs JDK. Please use the --jdkhome\n \
192
    command line switch to specify the path to your JDK.
193
# {0} - path to JRE
194
# {1} - messages 
195
MSG_NEEDJDK_TITLE=This application can run only on JDK!
(-)core/startup/src/org/netbeans/core/startup/Main.java (+21 lines)
Lines 361-366 Link Here
361
    StartLog.logProgress ("Upgrade wizard consulted"); // NOI18N
361
    StartLog.logProgress ("Upgrade wizard consulted"); // NOI18N
362
362
363
    //
363
    //
364
    // JDK check
365
    //
366
    String classToCheck = NbBundle.getMessage(Main.class, "JDK_CLASS_TO_CHECK"); // NOI18N
367
    if (!"null".equals(classToCheck)) { // NOI18N
368
        try {
369
            Class.forName(classToCheck);
370
        } catch (ClassNotFoundException ex) {
371
            String h = System.getProperty("jdk.home");
372
            if (h == null) {
373
                h = System.getProperty("java.home");
374
            }
375
            String msg = NbBundle.getMessage(Main.class, "MSG_NEEDJDK", h, ex.getMessage()); // NOI18N
376
            String title = NbBundle.getMessage(Main.class, "MSG_NEEDJDK_TITLE", h, ex.getMessage()); // NOI18N
377
            int result = JOptionPane.showConfirmDialog(null, msg, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
378
            if (result != JOptionPane.OK_OPTION) {
379
                org.netbeans.TopSecurityManager.exit(5);
380
            }
381
        }
382
    }
383
    
384
    //
364
    // 8.5 - we can show the splash only after the upgrade wizard finished
385
    // 8.5 - we can show the splash only after the upgrade wizard finished
365
    //
386
    //
366
387
(-)ide/branding/core/startup/src/org/netbeans/core/startup/Bundle_nb.properties (+11 lines)
Lines 44-46 Link Here
44
44
45
LBL_splash_window_title=Starting NetBeans IDE
45
LBL_splash_window_title=Starting NetBeans IDE
46
currentVersion=NetBeans IDE Dev (Build {0})
46
currentVersion=NetBeans IDE Dev (Build {0})
47
48
49
#
50
# NOI18N - We need to run on JDK that provides debugger
51
JDK_CLASS_TO_CHECK=com.sun.jdi.VirtualMachineManager
52
# {0} - path to JRE
53
# {1} - messages 
54
# MSG_NEEDJDK=...
55
# {0} - path to JRE
56
# {1} - messages 
57
MSG_NEEDJDK_TITLE=NetBeans IDE can run only on JDK!

Return to bug 66960