Set up the Eclipse IDE environment for JDownloader

Setting up the IDE eclipse


Most members of the team work on JDownloader using the free Java IDE Eclipse.
The source code of JDownloader is stored on the code "Subversion" server. To check out the latest code and commit changes, you need a Subversion client.
We prefer an integrated solution and therefore use the Eclipse plug-in  Subclipse as the Subversion  client.


Install all required tools

  1. Any supported Java JDK: OpenJDK, Adoptium, AdoptOpenJDK, Oracle, IBM, Zulu, Zing, Corretto, Microsoft
  2. Eclipse IDE for Java developers

Setting up Eclipse

Start eclipse. Eclipse will ask you to select a workspace.
This is the folder where Eclipse will save all code and project settings.

Add an installed Java JDK:
Click Window -> Preferences
Navigate to Java -> Installed JRE
If your preferred JDK is not listed or the list is empty, click [Add] and select "Continue using a standard virtual machine" ”->[Next], and then select [Directory] to select the JDK installation directory.
Typically this is something like C:\Program Files\Java\jdk1.8.0_202 (for Windows)

Select your preferred JDK and click [Apply and Close]


Install subeclipse

  1. Click [Help] -> [Eclipse Marketplace...]
  2. Search for the subclip and click the [Install] button on the right.

  3. Do not modify the preselected characteristics and click [Confirm]

  4. Read and agree to the TOS -> [Done]
  5. If you receive the prompt "Do you trust unsigned content from unknown sources?" click the checkbox in the "Type" column and click "Trust Selected."
    If needed, you can manually check the credibility of the source beforehand.

  6. Once Eclipse prompts you to do so, restart it.

Setup items

  1. Select menu→[File]→[New]→[Project] ( not "Java Project")

  2. Select [Checkout project from SVN] and click [Next]. Select "Create new repository location" on the next screen.

  3. Enter the first project svn URL:svn://svn.appwork.org/utils

  4. If Eclipse asks you, confirm checking out the root of the repository:

  5. Click [Finish] and approve all question dialog boxes with [Yes] or [OK]. Eclipse will now download and set up the project.
    Close the welcome screen to view the first item.

Note:
As you add the SVN repository, you should see a progress indicator in the lower right corner of Eclipse. If you get an error at this point, you don't see the directory structure under the SVN container, or if you're stuck at 0%, it's most likely due to not having the appropriate permissions on your firewall.
Add all outgoing ports (0:65535) on the firewall to the IP addresses of svn.jdownloader.org and svn.appwork.org (or whitelist the domain) and retry the previous steps.

After checking out the first project, the Eclipse window should look similar to the following screenshot:

Now repeat these steps:

  • svn://svn.jdownloader.org/jdownloader/browser
  • svn://svn.jdownloader.org/jdownloader/trunk
  • svn://svn.jdownloader.org/jdownloader/MyJDownloaderClient

Run JDownloader

In Eclipse's Package Explorer tab, expand the "JDownloader" project and navigate to:

Find the file, right-click on it -> Run As -> Java Application
The first launch may take some time.
You can now test the latest developer version of JDownloader and become familiar with the code.JDownloader/src.org.jdownloader.startupMain.java

Optional:

If necessary, program parameters and virtual machine parameters can be modified as follows:
Find the file, right-click on it, select Run As -> Run Configuration -> Double-click "Java Application" to open the "Run Configuration"
menu.Main.java


Configuring the AppWork code formatter

In order to keep the code layout the same between different contributor IDE setups, we want to use our code formatter for all commits.

  1. Go to Window->Preferences->Java->Code Style->Formatter and click "Import"

  2. Select the file located at:
    Click [Open], then [Apply and Close][YourEclipseWorkspace]/AppWorkUtils/ide/eclipse/eclipse_format_file.xml

     


How to debug jar files in eclipse

  1. Start JDownloader with the following additional parameters:
    java -Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y -jar JDownloader.jar
  2. Open Eclipse:
    Debug Configuration → Remote Java Application.
    Select the JDownloader project and port 8000 to start debugging.

How to upload/commit/write changes?

To upload to the code server, you need write permission. Basically, everyone gets write access.

To gain write permission, please write an email to  [email protected] with the following content:
Username (name under which your code will be released)
Permission to re-license your submission. Example:
Herby I allow AppWork GmbH, Schwabacher Straße 117, 90763 Fürth to reauthorize me (as user '<YOUR USERNAME>') to submit to the JDownloader code server (svn.jdownloader.org).
In this case, relicensing means modifying and distributing my changes under a new license.


Known issues/troubleshooting

Synthetic license warning every time JDownloader starts

In fact, if this happens, the Synthetica license is lost.
Here are two possible solutions:

Solution 1

  1. In JDownloader, go to Settings -> Advanced Settings -> Search GUI Settings.lookandfeeltheme -> Change the value in the "Value" column to and restart JDownloader.FLATLAF_LIGHT
  2. Find your working directory. If you don't know where it is, just follow the instructions here to find it..jd_home
  3. Close JDownloader.
    Navigate to your JDownloader and navigate to your working directory, double-click JDownloader.jar to start JDownloader once outside the IDE..jd_home
  4. Let it update itself and close it again.
    Once completed, you should no longer receive warnings when launching JDownloader in the IDE.

Solution 2

If you have a stable JDownloader installation, you can copy the "licenses" folder from your existing installation to the folder containing the Eclipse compiled files..jd_home

Guess you like

Origin blog.csdn.net/allway2/article/details/133380337