Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Eclipse IDE  (Read 11099 times)

0 Members and 1 Guest are viewing this topic.

Base10

    Topic Starter


    Beginner
  • Thanked: 1
    • Experience: Expert
    • OS: Windows 7
    Eclipse IDE
    « on: February 24, 2020, 09:00:20 AM »

    Hey there,

    Just a quickie.  Installing Eclipse IDE.  Looks like its a stand alone that just runs like a portable app.  Is that correct or should it still be in my uninstall programs?

    Just asking because as I have a slight issue.  It's when I open it and try using the tutorial for "create a Hello World SWT application".  When I open this it asks me to "Open the Java perspective, however its not there.  Also doing the import of the "Import the SWT project from target platform using the PDE... well I follow the instructions and again I don't have it there.

    Any info how to use Eclipse optimally, because I don't think I've done it correctly, would be great thanks!

    I have done a simple hello world and it runs fine.  Although when compiling to a .jar file it compiles but when I run it it doesn't seem to run.  I can write it in notepad++ and save as .java and run javac on it and it's okay that way.  I just want to use Eclipse as effectively as I can to build up my java skills though.

    thanks!


    Base10

      Topic Starter


      Beginner
    • Thanked: 1
      • Experience: Expert
      • OS: Windows 7
      Re: Eclipse IDE
      « Reply #1 on: February 24, 2020, 10:25:30 AM »

      The code I was trying to get working was as below, but it says that Display and Shell cannot be resolved to a type.

      Code: [Select]
      public class MySWT {

      public static void main(String[] args) {

      Display display = new Display();
      Shell shell = new Shell(display);
      shell.setText("Hello world!");
      shell.open();
      while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();}

      }

      }

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Eclipse IDE
      « Reply #2 on: February 24, 2020, 02:30:36 PM »
      If you don't have a Java Perspective visible in Window->Open Perspective (including checking the list in "Other..." then you may have downloaded a copy of Eclipse that was not intended for Java development.

      As for Display and Shell, you need to add a reference to the SWT jar file. It should be in the plugins directory in the eclipse directory. (org.eclipse.swt<version>.jar)
      I was trying to dereference Null Pointers before it was cool.

      Base10

        Topic Starter


        Beginner
      • Thanked: 1
        • Experience: Expert
        • OS: Windows 7
        Re: Eclipse IDE
        « Reply #3 on: February 25, 2020, 04:49:21 AM »

        Hi there,

        Thanks Dave.  Will give another download a try and see what happens.  I'll close the thread just now and re-open if need further assistance. 

        Cheers mate!

        Base10

          Topic Starter


          Beginner
        • Thanked: 1
          • Experience: Expert
          • OS: Windows 7
          Re: Eclipse IDE
          « Reply #4 on: February 25, 2020, 04:04:04 PM »


          Sorry meant BC not Dave, was doing another post at the same time, sorry about that!