Wikipedia:WPCleaner/Installation

WPCleaner is a maintenance tool, developed with Java 8+. The installation program is hosted on Toolforge since release 2.0 of WPCleaner. The minimum required version is Java 8, and it should run with any later version.

Prerequisites
Prerequisites to install and use WPCleaner are:
 * Java, at least in release 8
 * Any operating system, as long as it supports Java 8 or more recent

Installation with WPCleaner installer
The easiest way to install WPCleaner is with the dedicated installation program (Note: currently, the installation program has only been tested on a small number of computers running a Windows or Ubuntu operating system, so please report any result with your installation on WPCleaner's talk page).

The following actions are required to install WPCleaner:
 * Download the installer from WMFLabs (don't worry if there's a warning,  files are supposed to be executable files)
 * Run the installer (if Java is correctly installed and configured, opening the downloaded jar file should run the installer )
 * Provide the required information for the configuration:
 * Installation folder: select the folder where WPCleaner will be installed. Note: Avoid selecting a folder inside a folder protected by specific rights (like  or   on Windows).
 * Wiki: the wiki you would like to connect to by default.
 * Language: the language in which you would like to use WPCleaner.
 * Username: your username (optional).
 * Password: your password (optional).
 * Choose if you want the installer to create a shortcut for WPCleaner. If the username and password have been provided, this shortcut will start WPCleaner with the given credentials. Note: Creating a shortcut only works for a few operating systems.
 * Choose if you want to install the beta version of WPCleaner (select this option only if you want to check beta features of WPCleaner)
 * Click on Install and wait for the installation to complete.

Note: This procedure is a wrapper for the installation with getdown, so the automatic updating of WPCleaner will be handled by getdown.

Installation with getdown
Another way to install WPCleaner is with getdown, an independent tool dedicated to installing and automatic updating of Java programs. This installation lets you automatically update WPCleaner at each execution.

The following actions are required to install WPCleaner:
 * Create a dedicated folder for WPCleaner (noted as  in the explanations). Note: Avoid creating this folder in a folder protected by specific rights (like   or   on Windows).
 * Download the following files and place them in this folder:
 * getdown.txt (if your browser displays the file contents instead of suggesting you to save the file locally, you can try right-clicking on the link and use an option like "Save link as...")
 * getdown.jar (don't worry if there's a warning,  files are often considered as executable files, which they are)
 * To finish the installation:
 * Under Windows:
 * Open a command line (cmd or PowerShell)
 * Go inside the created folder (command, for example  )
 * Run the command  to ensure that Java is properly installed and that its version is at least 1.8
 * Run the command  (for example,
 * Under Linux:
 * Open a command line (Terminal, Shell)
 * Go inside the created folder (command, for example  )
 * Run the command  to ensure that Java is properly installed and that its version is at least 1.8
 * Run the command  (for example,  )
 * Under MacOS:
 * Install JDK 10
 * Open a command line (Applications &rarr; Utilities &rarr; Terminal)
 * Go inside the created folder (command, for example  )
 * Run the command  to ensure that Java is properly installed and that its version is at least 1.8
 * Run the command  (for example,  )


 * Under another operating system, it's probably very similar to the installation under Linux
 * Getdown will then retrieve all the necessary files for using WPCleaner, and start WPCleaner

You can customize WPCleaner installation to simplify its daily usage:
 * Create shortcuts to start WPCleaner
 * Create a file containing your connection credentials ( : replace credentials between square brackets by the correct values):
 * Create personalized scripts
 * Create a file  in which each line is an option added to the JVM used by WPCleaner (for example, to increase the maximum size of the memory used to 8 GB, create this file with the line  )
 * Note: files downloaded by getdown should not be modified, because any modification will be replaced at the next execution of WPCleaner.

Usage
To start the graphical interface of WPCleaner, you can using the following methods (It is advised to create a shortcut or optionally for the Mac, an Automator script):
 * Under Windows:
 * Double click on
 * Run the command  so that WPCleaner connects automatically to the English Wikipedia (the file   needs to be created beforehand)
 * Run the command  so that WPCleaner connects automatically to the English Wikipedia
 * Under Linux :
 * Double click on
 * Run the command so that WPCleaner connects automatically to the English Wikipedia (the file   needs to be created beforehand)
 * Run the command so that WPCleaner connects automatically to the English Wikipedia
 * Under Mac OS :
 * Locate and open /Applications/Automator.app in the Finder window.
 * Click type "Application" and double-click "Run shell script" from the middle list.
 * Replace the default "cat" text on the right side with  (for example, if you installed the script in /Applications/WPCleaner2, your Automator command would be  )
 * Save the Automator script into your Applications folder. Call it "WPCleaner2.app" or another name that makes sense to you.
 * To change the icon for this new application:
 * Right-click on the new app and choose Get Info.
 * In the WPCleaner2 installation folder, double-click on WPCleaner.png to open it.
 * In the Preview window that opens, double-click on the image and then Copy it to the clipboard (Edit > Copy).
 * In the Get Info window for your new WPCleaner2 app, click once on the small icon at the far upper left, then choose Edit > Paste. Close the Get Info window.
 * You should be able to double-click your new WPCleaner2.app to start WPCleaner 2.
 * Under any operating system (Windows, Linux or other) :
 * Run the command  from the installation folder (Note the " " at the end of the command which is mandatory)
 * Run the command  from the installation folder so that WPCleaner connects automatically to the English Wikipedia (the file   needs to be created before hand)
 * Run the command  from the installation folder so that WPCleaner connects automatically to the English Wikipedia

To run WPCleaner in bot mode without any graphical interface (handling specific tasks), check the file  or   for explanations about the parameters to be used.

Troubleshooting
This section tries to give answers for a few possible problems arising during the installation.

Java version
Even if you've installed Java 8 or more recent on your computer, the one that is used in the command line may be an older one. You can see this problem at several steps in the installation process: In each case, it means that the command line is using an older version of Java. You can either uninstall the older Java or make sure that the command line uses the newer Java.
 * When you run the command, the reported version can be below 1.8
 * When you run the installation command with getdown, you get an UnsupportedClassVersionError exception saying "Unsupported major.minor version 51.0" (version 51.0 is for Java 7, 52 for Java 8)

For Mac installation, it seems to be a known problem (see this thread), but installing JDK 10 is likely to solve the problem.

Security
WPCleaner needs your Wikipedia login and password to read and edit articles on which you want to work. To test WPCleaner, without the ability to save your modifications, you can use the Demo mode without providing a password.

If you have activated two-factor authentication on your Wikipedia account, you need to create a bot password for WPCleaner, cf. this guide.

Network configuration
If you have a special network configuration (proxy, ...), some further configuration might be required.

User box
If you want to show on your user page that you're using WPCleaner, you can use  which will add the following user box

Using same preferences on another computer
On Windows, WPCleaner stores most of its information in the Windows registry. If you change your computer and want to keep your configuration, you just need to copy the WPCleaner part of the registry from the old computer to the new one.

To copy your Windows configuration from one PC to a new PC, you can use Regedit:
 * 1) On the old PC, click Start > Run...
 * 2) Type regedit and click OK
 * 3) Select the folder HKEY_CURRENT_USER\Software\JavaSoft\Prefs\org\wikipediacleaner
 * 4) Click File > Export...
 * 5) Enter a file name and click Save
 * 6) Copy the .reg file from the old PC to the new PC
 * 7) On the new PC, right click on the .reg file and choose Merge
 * 8) When asked "Are you sure you want to add the information", click Yes
 * 9) Once the merge is complete, click OK

For Mac and Linux, there's a preference file for WPCleaner that can be copied over to another computer that uses Linux or Mac.