-
JDK (or JRE)
Find the steps to add Java path to environment variable here
To check if you have working JDK executejava -versionin terminal -
Eclipse IDE (Download Eclipse for Enterprise Java Developers)
-
Apache Tomcat (Download binary distributions)
Follow the steps on aka.ms/EmbedForCustomer
-
Open Eclipse and Click Window > Show View > Select Servers.
-
Setup Tomcat server
- Go to Servers tab, click No servers are available. Click this link to create new server...
- Select v9.0 Tomcat version from Apache
- Click Next
- Click browse, then select the folder which contains Tomcat
- Select JRE which is available through system variable
- Click Finish
- There should be a Tomcat server now in the Servers tab
-
To import project, Click File > Open Project from File System > Click on Directory > Select Update Credentials folder > Finish
-
Let Maven finish automatically downloading the dependencies in background.
-
Add Tomcat server to the project
- Right click EncryptCredentials (project's name) from Project Explorer and then click Properties
- Select Targeted Runtimes
- Select Apache Tomcat from the list
- Click on Apply and Close
-
Fill in the required parameters in the Config.java file related to AAD app, Power BI report, workspace, and user account information.
-
Run the project
- Right click project's name from Project Explorer
- Select Run As > Run on Server
- Select the created server and click Finish
- http://localhost:8080/encryptcredential should open in browser
-
Google Chrome
-
Microsoft Edge
-
Mozilla Firefox
-
For security reasons, in a real world application, passwords and secrets should not be stored in config files. Instead, consider securing your credentials with an application such as Key Vault.
-
Do not use default browser provided by eclipse for running the sample on server.
Note:
- The Azure AD Service Principal which is used for authentication should have admin rights on the corresponding workspace.
- If Service Principal mode is used for authentication and on-premises gateway is used, then SP should be the gateway admin.
Windows shows "File path too long" during Eclipse IDE setup extraction.
Skip the files during extraction whose paths are too long
Windows shows error popup while trying to run the eclipse.exe file.
Check the size of the extracted Eclipse setup folder. It should be ~599 MB.
Eclipse shows "Building has encountered a problem" or "Maven is not configured properly" error after importing the project.
- Delete folder named 2.6 from %userprofile%\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\ directory
- Right click project's name from Project Explorer > Maven > Update Project > Check Force Update of Snapshots/Releases > Click Ok
Eclipse shows "The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports." error while starting the Tomcat server.
- Click on Servers tab on the event log area of the IDE
- Double click on the server name which says "Tomcat v9.0 Server at localhost..."
- Set the Tomcat admin port to any available port (for e.g. 8079)
"Run on Server" option is not visible for running the project.
- Right click on the project > Properties > Project Facets
- Select Dynamic Web Module, Java, and JavaScript options are selected.
- Click on Apply and Close.