Setup IDE Eclipse
Most of the team uses the free Java IDE Eclipse to work on JDownloader.
JDownloader's Sourcecode is stored on a code „Subversion“ server. To Check out the latest code, and to commit changes, you need a Subversion client.
We prefer an integrated solution, and thus use the Eclipse addon Subclipse as Subversion client.
Install all required tools
Set up Eclipse
Start Eclipse. Eclipse will ask you to choose your workspace.
This is the folder where Eclipse will save all your code and project settings.
Add the installed Java JDK:
Click on Window -> Preferences
Navigate to Java -> Installed JREs
If your preferred JDK is not listed or the list is empty, click [Add], Select "Continue with Standard VM" -> [Next] and select [Directory] to choose your JDK install directory.
Usually this is something like C:\Program Files\Java\jdk1.8.0_202 (for Windows)
Select your preferred JDK and click on [Apply and close]
Install Subclipse
Setup projects
svn://svn.appwork.org/utils
Note:
When adding the SVN repository, you should see a progress indicator in the bottom right corner of Eclipse. If you get an error at this point, do not see a directory structure under the SVN container, or if you are stuck at 0% this is most likely due to not having proper permissions on your firewall.
Add all outgoing ports (0:65535) on your firewall to IP addresses of svn.jdownloader.org and svn.appwork.org (or whitelist domains) and try the previous steps again.
After checking out the first project, your Eclipse window should look similar to the following screenshot:
Now repeat these steps with:
svn://svn.jdownloader.org/jdownloader/browser
svn://svn.jdownloader.org/jdownloader/trunk
svn://svn.jdownloader.org/jdownloader/MyJDownloaderClient
Run JDownloader
1. In Eclipse's Package Explorer tab, expand the "JDownloader" project and navigate to:JDownloader/src.org.jdownloader.startup
2. Find the file Main.java
, right-click on it -> Run as -> Run Configurations... -> Switch to tab "Arguments" and enter the following lines into field "VM arguments":
--add-exports=java.desktop/sun.swing=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.table=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.plaf.synth=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.tree=ALL-UNNAMED
--add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.shell=ALL-UNNAMED
--add-exports=java.base/sun.security.action=ALL-UNNAMED
--add-exports=java.desktop/com.sun.awt=ALL-UNNAMED
Technical background if you're interested:
https://www.jyloo.com/synthetica/faq/
-> See "I'm getting an IllegalAccessError or illegal reflective access warning - what's going wrong?"
3. Right-click on it again -> Run as -> Java Application
The first start may take some time.
You may now test out the latest developer build of JDownloader and familiarize yourself with the code.
Configuring AppWork Code Formatter
In order to keep code layouts the same between the different contributors IDE setups, we prefer all commits be made using our code formatter.
[YourEclipseWorkspace]/AppWorkUtils/ide/eclipse/eclipse_format_file.xml
How to debug a jar file in eclipse
java -Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y -jar JDownloader.jar
How can I upload/commit/write my changes?
To upload to your code server, you need write access. Basically, everybody can get write access.
To get write access, please write an E-Mail with the following content to support@jdownloader.org:
Username (Your code will be published under this name)
Allowance to relicense your commits. Example:
Herby I allow AppWork GmbH, Spalter Straße 58, 91183 Abenberg, to re-license my (as user '<YOUR USERNAME>') commits to the JDownloader Code Server (svn.jdownloader.org).
Re-licensing, in this case, means modifying and distributing my changes under a new license.
Known Problems / Troubleshooting
Synthetica License Warning each time after JDownloader is started
Indeed if this happens, the Synthetica License is missing.
Here are two possible solutions:
Solution 1
FLATLAF_LIGHT
and restart JDownloader..jd_home
. If you don't know where it is, simply find it as described here..jd_home
working directory, start JDownloader one time outside your IDE by doubleclicking JDownloader.jar.Solution 2
If you have a stable JDownloader installed, you can copy the "licenses" folder from that existing installation into your .jd_home
folder containing the files compiled by Eclipse.