-
Notifications
You must be signed in to change notification settings - Fork 139
Setting Up Eclipse
It is recommended to use Eclipse for PKI development, although that is not required. As a Java IDE, Eclipse provides:
-
auto build so code issues can be detected immediately
-
auto completion so it’s easier to write the code
-
auto formatting so the code style will be more consistent (i.e. easier to read)
-
auto dependency management so the import statements will be more consistent (i.e. easier to cherry-pick)
and many other useful functionalities.
PKI repositories has been set up such that it can easily be added into Eclipse.
To install Eclipse on Fedora:
$ dnf install eclipse-jdt
It will add an icon in the desktop’s Favorites.
To start Eclipse, click the Eclipse icon in the desktop’s Favorites or execute the following command:
$ eclipse
It may ask you to select a workspace to store project metadata.
To add the Java project into Eclipse, first clone the project into a local repository, for example:
$ git clone [email protected]:dogtagpki/pki.git
Install the build dependencies, for example:
$ dnf builddep pki-core
Then execute the following steps in Eclipse:
-
Click File → New → Java Project.
-
Enter the Project name, e.g.
pki
. -
Uncheck Use default location.
-
In Location enter the path to the cloned project repository, e.g.
/home/<username>/Projects/pki
. -
Click Finish.
If the project already has the .project
and .classpath
files in the project’s main folder, the project build path is already set up so Eclipse can build the code automatically, and there should be no errors. The project can be used immediately.
If some dependencies are still missing, try to install it manually:
$ dnf install <package>
Then fix the RPM spec file so that dnf builddep
will install the complete dependencies.
It’s also possible that some dependencies are no longer needed/available. In that case fix the project build path or fix the .classpath
manually, then commit the changes into the repository.
If the project doesn’t have the .project
and .classpath
files, it may be necessary to configure the project build path manually before the project can be used. Once these files are created, commit the files into the repository so others can use the files too.
To switch to a different branch, execute the following command:
$ git checkout <branch>
Then right-click on the project in Eclipse, and select Refresh.
If Eclipse keeps crashing on start, try removing the ~/.eclipse
folder and restart Eclipse. It’s not necessary to remove the workspace folder.
If it’s still not working, try removing all Java packages (including JDK) then reinstall Eclipse.
The following error message may appear after upgrading Java:
The container 'JRE System Library [...]' references non existing library '...'
To fix the problem, try restarting Eclipse.
If the problem persists, try the following steps:
-
Right-click on the project and open Properties.
-
Select Java Build Path → Libraries.
-
Select JRE System Library.
-
Click Remove.
-
Click Add Library….
-
Select JRE System Library.
-
Select Workspace default JRE.
-
Click Finish.
-
Click Apply and Close.
Tip
|
To find a page in the Wiki, enter the keywords in search field, press Enter, then click Wikis. |