-
Notifications
You must be signed in to change notification settings - Fork 122
Importing into Eclipse
Eclipse IDE can be downloaded for free from here.
Since openroberta-lab is a fronend- and backend project, we recommend installing Eclipse IDE for Enterprise Java and Web Developers
.
Eclipse setup is fairly simple. Before we import the Open Roberta Lab project into the eclipse workspace first we have to modify some settings.
We have designed our code style formatter for Java code.
- Go to Window -> Preferences -> Java -> Code Style-> Formatter and import openRobertaJava formatter from /Resources/formatter folder
Eclipse formatter in Window -> Preferences -> Web -> Client-side Javascript -> Formatter is ignored by the new Eclipse Web Development Plugin Wild Web Developer
(more info). Instead WWD uses tsfmt und can be configured by a tsfmt.json
file in the project root directory.
- Go to Window -> Preferences -> Web -> HTML files -> Editor and
- set
Line width to 160
- select
Indent using spaces
- make sure all other checkboxes are not activated
- set
Indentation size
to 4 - select "Lowercase" for "Tag names" and "Attribute names"
- set
Another thing to configure in Eclipse is to setup 'save actions' in Window -> Preferences -> Java -> Editor. They should be all ticked with 'Format all lines selected'. Actions themselves should be the following:
- Add 'this' qualifier to unqualified field accesses
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Convert control statement bodies to block
- Add final modifier to private fields
- Use lambda where possible
- Remove unnecessary parentheses
- Remove unused imports
- Add missing '@Override' annotations
- Add missing '@Override' annotations to implementations of interface methods
- Add missing '@Deprecated' annotations
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
- Correct indentation
Also enable the 'Format source code' 'save action' for JavaScript.
If you wish to counter long package names and provide somewhat clearer package explorer view, then go to Window -> Preferences -> Java -> Appearance and tick the "Abbreviate package names" checkbox. A suggested template for this is as follows:
- de.fhg.iais.roberta={rob}
- de.fhg.iais.roberta.syntax={syntax}
- de.fhg.iais.roberta.mode={mode}
- de.fhg.iais.roberta.factory={factory}
This assumes that you have read and followed the 'ReadMe' page in our git repository.
- Open Eclipse and use 'File | Import' to import "Existing Maven Projects"
- Set the 'openroberta-lab' directory that was cloned with git as the root directory
- Check that all projects are selected, and finish
- If a window pops up with m2e connectors, click "Resolve All Later" and finish
- In the Project Explorer, select 'OpenRobertaServer' and hit Alt+Enter to open the properties
- In the properties window, under 'Java Build Path', select the 'Projects' tab and add all robots as required projects (Not WedoInterpreter)
- Go to OpenRobertaServer project (
de.fhg.iais.roberta.main
) and locate 'ServerStarter.java' - Right-click on
public static void main(String[] args)
and select 'Run As | Java Application'- The server will start and immediately crash because there are program arguments missing
- In the Menu bar, open 'Run | Run Configurations...'
- in 'Arguments | Program arguments' add:
-d server.staticresources.dir=./OpenRobertaServer/staticResources
-d robot.crosscompiler.resourcebase=../ora-cc-rsc
- in Working directory: Check 'Other' and add:
/home/<username>/OpenRoberta/openroberta-lab/
(relative paths might not work)
- in 'Arguments | Program arguments' add:
- Run the server and it will be accessible on localhost:1999
If you encounter an error with hibernate go to run configurations in Eclipse (drop-down arrow next to green run button), select ServerStarter and go to Arguments, add this argument as well:
-d hibernate.connection.url=jdbc:hsqldb:file:<path to git repository>/OpenRobertaServer/db-embedded/openroberta-db
After updating certain resources or if something gets cached and does not change, right click on any project and go to Maven | Update Project, in the window that pops up, select all related projects and update. If this does not help, open Terminal (e.g. Git Bash) and type:
cd openroberta-lab
mvn clean install
If you encounter "name of robot" has invalid factory - class not found exception
- this is due to the fact that your classpath is not updated. Right click OpenRobertaServer project, go to Properties -> Java Build Path -> Projects and add all robot plugin projects and click "Apply". Now all needed classes should be on the class path.
Home | Community | Installation | Team
Installation Tutorials
- Instructions to run a openroberta lab server using DOCKER
- Instructions to run the Open Roberta Lab Server natively on ubuntu ‐ not recommended
- Raspberry Pi 2/3/4 and the Open Roberta Lab
- EV3 and leJOS
- EV3 and ev3dev
- Creating the OR leJOS image
- Arduino Create Agent
- Mbed DAL: Generation and automation
Development
-
Workflows
-
Architecture
-
Blockly
-
Software engineering issues
-
Misc
-
Notes on robots
Textual Representation
Contribution
Discussions on future development