How to compile this applet ?
Content of this page
Install eclipse
Get the applet sources
Basic compilation, with eclipse
Ant build file
Eclipse is the best way to develop the java stuff, like the applet. Go to
eclipse.org to download it.
To get sources from the sourceforge Subversion (conf management), you'll have to install the eclipse
subversion plugin. This is optionnal, as you can also get sources from the JUpload releases (see below).
Take care that there are two eclipse plugins for SVN: subversion (on polarion.org) and subclipse (on tigris.org). I
prefer the first one: the second one let you do anything, and I did several mistakes in my SVN with it. An easy
way to install it is to use the eclipse software management function:
- Click on 'Help / Software Updates / Find and Install'
- If there is no 'Subversive update site', go to
subersion eclipse plugin,
or add a new remote site, with this URL (for eclipse 3.2 and 3.3):
http://www.polarion.org/projects/subversive/download/1.1/update-site/
- If there is no 'Subclipse update site', add a new remote site, with this URL:
http://subclipse.tigris.org/update_1.2.x
- Check both subclipse and 'Europa Discovery site' (Europa is the eclipse 3.3 release)
- Click on 'Finish'. Eclipse will load the package list for the selected items.
- The list of available packages is displayed. Select the subversion plugin. Eclipse will help you to manage
dependancies, by showing you the lacking ones, and a button that selects the necessary packages.
There are two ways:
- Get one JUpload release, by downloading a JUpload release file, from the sourceforge download page.
- Download it from SVN ... from the sourceforge SVN. By doing this, you can get any release, by using the
relevant SVN branch/tag. You can also get the trunk sources, to get the last commited source files.
The easiest way is to download a JUpload release. See below, for information on how to get the sources from the
sourceforge Subversion.
This is the simplest way to run the applet. Use the JUpload releases.
Create a new project:
- menu : 'File / New / Project'
- In the dialog box: select 'Java / Java Project'. Click on 'Next'
- Enter a project name, and all other default values. Check that 'separate folders for sources and class files' is selected.
- Click on 'Finish',
- Right click on the newly created project
- Select 'Import...'
- In the dialog box: select 'General / Archive File' . Click on 'Next'
- Browse to the archive file. Click on 'Finish'
- Answer 'Yes' to all the 'overwrite' eclipse validation.
To launch the applet:
- Right-click on your project,
- Select 'Run as' or 'Debug as', then 'Java applet'
- Select the 'JUploadApplet'. This will let you to several errors in the console... but initilized the application in eclipse... You now only have to set the applet parameters.
To set applet parameters:
- Open the menu 'Run / Open Debug Dialog...' (or 'Run / Open Run Dialog...')
- The JUploadApplet should be selected, in the 'Java applet' section. If not, select it.
- On the right panel, select the 'Parameter' entry
- Just add the necessaru applet parameter. At least one: the postURL.
- Click on 'Debug'
To launch the applet a second time:
- Just click on the 'bug', on the tool bar, or hit F11. It will launch the last launched application, in debug mode.
Caution: prior to applet 3.1.0, you must first run the Ant build file before being
able to compile with eclipse
An ant build file is given with JUpload, to generate two main targets:
- The default one, 'deploy', create the compiled jar file. Its main advantage, is that it creates or updates
the /conf/svn.properties file, that contains the applet version (see wjhk.jupload2.JUploadApplet#VERSION
attribute) and last SVN commit number.
- The 'dist' creates a jar containing a jupload release, including: sources and wwwroot directory, with javadoc.
To use this ant build file (build.xml), with eclipse: just right on it, and choose Run as / ant build.
You must have eclipse, with the subversion plugin installed. Then, you have to do these steps:
- Open the Java perspective (menu: window / open perspective / java)
- On the left panel (should be 'package explorer'), right click,
- Select 'New / Project'
- Then, select 'SVN / Check out project from SVN'
- Create a new repository location: URL is: https://jupload.svn.sourceforge.net/svnroot/jupload
- Click on 'Finish'