File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,20 @@ static public boolean isAvailable() {
8686
8787 static public void init () {
8888 try {
89- Class <?> platformClass = Class .forName ("processing.app.Platform" ); //$NON-NLS-1$
89+ // Start with DefaultPlatform, but try to upgrade to a known platform
90+ final String packageName = DefaultPlatform .class .getPackageName ();
91+ Class <?> platformClass =
92+ Class .forName (packageName + ".DefaultPlatform" );
93+
9094 if (Platform .isMacOS ()) {
91- platformClass = Class .forName ("processing.app.platform. MacPlatform" ); //$NON-NLS-1$
95+ platformClass = Class .forName (packageName + ". MacPlatform" );
9296 } else if (Platform .isWindows ()) {
93- platformClass = Class .forName ("processing.app.platform. WindowsPlatform" ); //$NON-NLS-1$
97+ platformClass = Class .forName (packageName + ". WindowsPlatform" );
9498 } else if (Platform .isLinux ()) {
95- platformClass = Class .forName ("processing.app.platform. LinuxPlatform" ); //$NON-NLS-1$
99+ platformClass = Class .forName (packageName + ". LinuxPlatform" );
96100 }
97101 inst = (DefaultPlatform ) platformClass .getDeclaredConstructor ().newInstance ();
102+
98103 } catch (Exception e ) {
99104 Messages .showError ("Problem Setting the Platform" ,
100105 "An unknown error occurred while trying to load\n " +
You can’t perform that action at this time.
0 commit comments