• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

Settings and Preferences for Eclipse IDE for JAVA Developers (Luna)

Scheduled Pinned Locked Moved Developers Zone
ideeclipsejava
12 Posts 3 Posters 11.1k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    jkandasa
    last edited by jkandasa 3 Apr 2016, 21:02 2 Mar 2016, 23:27

    To maintain code style and format across developers contribution,
    we have to use the following style files on ecplise IDE for MyController Java codes.

    Clean Up Templates

    File: mycontroller-eclipse-preferences-java-codestyle-cleanup.xml

    • Window -> Preferences -> Java -> Code Style -> Clean Up -> Import…
    • Select mycontroller-eclipse-preferences-java-codestyle-cleanup.xml -> and click OK

    Import Code Templates

    File: mycontroller-eclipse-preferences-java-codestyle-codetemplates.xml

    • Window -> Preferences -> Java -> Code Style -> Code Templates -> Import…
    • Select mycontroller-eclipse-preferences-java-codestyle-codetemplates.xml and click OK

    Import Formatter

    File: mycontroller-eclipse-preferences-java-codestyle-formatter.xml

    • Window -> Preferences -> Java -> Code Style -> Formatter-> Import…
    • Select mycontroller-eclipse-preferences-java-codestyle-formatter.xml and click OK

    Import correct import order settings

    File: mycontroller-eclipse-preferences-java-codestyle-organizeimports.importorder

    • Window -> Preferences -> Java -> Code Style -> Organize Imports -> Import…
    • Select mycontroller-eclipse-preferences-java-codestyle-organizeimports.importorder and click OK

    Install lombok project in eclipse

    • Mycontroller.org using lombok project for builders. To install lombok with your eclipse. Watch demo video in lombok project page.
    • https://projectlombok.org/videos/lombok.ogv
    • Note: If double click of lombok.jar not launching, run java -jar lombok.jar and point out your eclipse installed location or extracted location.
    1 Reply Last reply Reply Quote 0
    • G Offline
      gbrd
      last edited by 4 Mar 2016, 14:10

      It seems that lombok is needed too.
      I did not succeed in installing it on eclipse mars for now.

      J 1 Reply Last reply 4 Mar 2016, 15:28 Reply Quote 0
      • J Offline
        jkandasa @gbrd
        last edited by 4 Mar 2016, 15:28

        @gbrd
        Yes, we need to install lombok in eclipse. Thank you for this. I have added tutorial video how to install lombok in eclipse.

        G 1 Reply Last reply 7 Mar 2016, 20:22 Reply Quote 0
        • G Offline
          gbrd @jkandasa
          last edited by 7 Mar 2016, 20:22

          @jkandasa ok clean project in eclipse mars seems enough to make it work.

          http://stackoverflow.com/questions/31297342/lombok-not-working-in-eclipse-mars

          1 Reply Last reply Reply Quote 1
          • F Offline
            Fraid
            last edited by Fraid 26 Dec 2016, 17:14

            @jkandasa I have a some issue installing the project.
            I’m using mac os 10.10.5, eclipse neon , lombok 1.16.12 and java 8.

            I can build from maven without issue, but eclipse still show me error about :

            *APPLICATION_JSON cannot be resolved to a variable AuthenticationHandler.java /mycontroller/modules/core/src/main/java/org/mycontroller/standalone/api/jaxrs line 48 Java Problem

            ALLOW_ANONYMOUS_PROPERTY_NAME cannot be resolved to a variable BrokerConfiguration.java /mycontroller/modules/core/src/main/java/org/mycontroller/standalone/mqttbroker line 67 Java Problem

            ClientResponse cannot be resolved to a type PushbulletUtils.java /mycontroller/modules/core/src/main/java/org/mycontroller/standalone/operation line 110 Java Problem

            ConnectionSource cannot be resolved to a type DataBaseUtils.java /mycontroller/modules/core/src/main/java/org/mycontroller/standalone/db line 63 Java Problem*

            Annotation @Slf4j also show in red. I thought at first it’s because of lombok but it’s actually installed (I can see it from about eclipse). But I created a simple test project, I can use lombok with annotation « @data » and @Slf4j without red warning.

            I also switch to lombok 1.16.10 and eclipse luna but no luck.

            Any idea what I missing, what is your project configuration eclipse, lombok version ?

            J 1 Reply Last reply 27 Dec 2016, 02:29 Reply Quote 0
            • J Offline
              jkandasa @Fraid
              last edited by 27 Dec 2016, 02:29

              @Fraid I never worked with MAC. However, the eclipse will be common on all platforms.

              Can you try to build as eclipse project via maven by executing the following command? And import as Existing project in to workspace

              git clone https://github.com/mycontroller-org/mycontroller
              cd mycontroller/
              mvn eclipse:eclipse
              
              1 Reply Last reply Reply Quote 0
              • F Offline
                Fraid
                last edited by 27 Dec 2016, 14:52

                Same issue, Build SUCCESS, no warning either but eclipse still showing red warning.

                1 Reply Last reply Reply Quote 0
                • F Offline
                  Fraid
                  last edited by 27 Dec 2016, 16:29

                  Not sure what happen, I previously has other project on maven, maybe there was some conflict.

                  I make it work now, by reinstalling/downloading everything from scratch (workspace deleted, m2 repo was also removed) then I run "mvn eclipse:eclipse", open eclipse.
                  Import maven project and worked now.

                  1 Reply Last reply Reply Quote 1
                  • F Offline
                    Fraid
                    last edited by 28 Dec 2016, 11:47

                    I think there is an issue with the Copyright settings.
                    When you create a new class, select "generate comments", the generated copyright will start like :
                    " Copyright 2016 Jeeva Kandasamy (jkandasa@gma...."

                    while maven license will check for header starting with:
                    "Copyright 2015-2016 Jeeva Kandasamy (jkandasa@gma...".
                    The build will failed.

                    Also formating code doesn't work as expected.
                    In GatewayUtils.java class for exemple, formating goes from the following :


                    SERIAL("Serial"),
                    ETHERNET("Ethernet"),
                    MQTT("MQTT"),
                    PHANT_IO("Sparkfun [phant.io]"),
                    PHILIPS_HUE("Philips Hue");
                    

                    to this:


                    SERIAL("Serial"), ETHERNET("Ethernet"), MQTT("MQTT"), PHANT_IO("Sparkfun [phant.io]"), PHILIPS_HUE("Philips Hue");
                    

                    J 1 Reply Last reply 29 Dec 2016, 01:40 Reply Quote 0
                    • J Offline
                      jkandasa @Fraid
                      last edited by 29 Dec 2016, 01:40

                      @Fraid Have you imported all the 4 files mentioned on main section for eclipse?

                      To add license file use the following command

                      mvn license:format
                      
                      F 1 Reply Last reply 29 Dec 2016, 23:31 Reply Quote 0
                      • F Offline
                        Fraid @jkandasa
                        last edited by 29 Dec 2016, 23:31

                        @jkandasa Yes I did over four time. Formatter and CleanUp section as for profile "MyController.org".
                        I'm using mac with Eclipse Helios.

                        J 1 Reply Last reply 30 Dec 2016, 01:53 Reply Quote 0
                        • J Offline
                          jkandasa @Fraid
                          last edited by 30 Dec 2016, 01:53

                          @Fraid I am using Eclipse Luna. Let me try with Helios.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          0

                          Online

                          632

                          Users

                          532

                          Topics

                          3.4k

                          Posts
                          Copyright © 2015-2025 MyController.org | Contributors | Localization