• Stars
    star
    136
  • Rank 258,230 (Top 6 %)
  • Language
    CSS
  • License
    Other
  • Created over 10 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Processing Library Template for Eclipse

The following describes how to set up a Processing Library project in Eclipse and build it successfully, and to make your Library ready for distribution.

Import to Eclipse

There are three options to import the template project into Eclipse: using it as a template, using a Git fork or using a downloaded package. If you are not familiar with Git or GitHub, you should opt for the downloaded package.

Option A: Use this template

  1. Use the repository as a template.
  1. Clone your new repository to your Eclipse workspace.
  • Open Eclipse and select the File β†’ Import... menu item.
  • Select Git β†’ Projects from Git, and click "Next >".
  • Select "URI" and click "Next >".
  • Enter your repository's clone URL in the "URI" field. The remaining fields in the "Location" and "Connection" groups will get automatically filled in.
  • Enter your GitHub credentials in the "Authentication" group, and click "Next >".
  • Select the master branch on the next screen, and click "Next >".
  • The default settings on the "Local Configuration" screen should work fine, click "Next >".
  • Make sure "Import existing projects" is selected, and click "Next >".
  • Eclipse should find and select the processing-library-template automatically, click "Finish".
  1. Rename your Eclipse project.
  • In the Package Explorer, right-click (ctrl-click) on the folder icon of the processing-library-template project, and select Refactor β†’ Rename... from the menu that pops up.
  • Give the project the name of your Library, and click "OK".

Option B: GitHub

  1. Fork the template repository to use as a starting point.
  • Navigate to https://github.com/processing/processing-library-template in your browser.
  • Click the "Fork" button in the top-right of the page.
  • Once your fork is ready, open the new repository's "Settings" by clicking the link in the menu bar on the right.
  • Change the repository name to the name of your Library and save your changes.
  • NOTE: GitHub only allows you to fork a project once. If you need to create multiple forks, you can follow these instructions.
  1. Clone your new repository to your Eclipse workspace.
  • Open Eclipse and select the File β†’ Import... menu item.
  • Select Git β†’ Projects from Git, and click "Next >".
  • Select "URI" and click "Next >".
  • Enter your repository's clone URL in the "URI" field. The remaining fields in the "Location" and "Connection" groups will get automatically filled in.
  • Enter your GitHub credentials in the "Authentication" group, and click "Next >".
  • Select the master branch on the next screen, and click "Next >".
  • The default settings on the "Local Configuration" screen should work fine, click "Next >".
  • Make sure "Import existing projects" is selected, and click "Next >".
  • Eclipse should find and select the processing-library-template automatically, click "Finish".
  1. Rename your Eclipse project.
  • In the Package Explorer, right-click (ctrl-click) on the folder icon of the processing-library-template project, and select Refactor β†’ Rename... from the menu that pops up.
  • Give the project the name of your Library, and click "OK".

Option C: Downloaded Package

  1. Download the latest Eclipse template from here. Don't unzip the ZIP file yet.
  2. Create a new Java project in Eclipse.
  • From the menubar choose File β†’ New β†’ Java Project.
  • Give the project the name of your Library.
  • Click "Finish".
  1. Import the template source files.
  • Right-click (ctrl-click) onto the folder icon of your newly created project in the Package Explorer and select "Import..." from the menu that pops up.
  • Select General β†’ Archive File, and click "Next >".
  • Navigate to the ZIP file you downloaded earlier in step 1, and click "Finish".

Set Up and Compile

  1. Add Processing to the project build path.
  • Open your project's "Properties" window.
  • Under "Java Build Path", select the "Libraries" tab and then "Add External JARs...".
  • Locate and add Processing's core.jar to your build path. It is recommended that a copy of core.jar is located in your Eclipse workspace in a libs folder. If the libs folder does not exist yet, create it. Read the section below regarding where to find the core.jar file.
  • Confirm the setup with "OK".
  1. Edit the Library properties.
  • Open the resources folder inside of your Java project and double-click the build.properties file. You should see its contents in the Eclipse editor.
  • Edit the properties file, making changes to items 1-4 so that the values and paths are properly set for your project to compile. A path can be relative or absolute.
  • Make changes to items under 5. These are metadata used in the automatically generated HTML, README, and properties documents.
  1. Compile your Library using Ant.
  • From the menu bar, choose Window β†’ Show View β†’ Ant. A tab with the title "Ant" will pop up on the right side of your Eclipse editor.
  • Drag the resources/build.xml file in there, and a new item "ProcessingLibs" will appear.
  • Press the "Play" button inside the "Ant" tab.
  1. BUILD SUCCESSFUL. The Library template will start to compile, control messages will appear in the console window, warnings can be ignored. When finished it should say BUILD SUCCESSFUL. Congratulations, you are set and you can start writing your own Library by making changes to the source code in folder src.
  2. BUILD FAILED. In case the compile process fails, check the output in the console which will give you a closer idea of what went wrong. Errors may have been caused by
  • Incorrect path settings in the build.properties file.
  • Error "Javadoc failed". if you are on Windows, make sure you are using a JDK instead of a JRE in order to be able to create the Javadoc for your Library. JRE does not come with the Javadoc application, but it is required to create Libraries from this template.

After having compiled and built your project successfully, you should be able to find your Library in Processing's sketchbook folder, examples will be listed in Processing's sketchbook menu. Files that have been created for the distribution of the Library are located in your Eclipse's workspace/yourProject/distribution folder. In there you will also find the web folder which contains the documentation, a ZIP file for downloading your Library, a folder with examples as well as the index.html and CSS file.

To distribute your Library please refer to the Library Guidelines.

Source code

If you want to share your Library's source code, we recommend using an online repository available for free at GitHub.

Adding core.jar and other .jar files to your classpath

The core.jar file contains the core classes of Processing and has to be part of your classpath when building a Library. On Windows and Linux, this file is located in the Processing distribution folder inside a folder named lib. On Mac OS X, right-click the Processing.app and use "Show Package Contents" to see the guts. The core.jar file is inside Contents β†’ Resources β†’ Java. For further information about the classes in core.jar, you can see the source here and the developer documentation here.

If you created a libs folder as described above, put the libraries you need to add to your classpath in there. In the "Properties" of your Java project, navigate to Java Build Path β†’ Libraries, and click "Add External JARs...". Select the .jar files from the libs folder that are required for compiling your project. Adjust the build.xml file accordingly.

The libs folder is recommended but not a requirement, nevertheless you need to specify where your .jar files are located in your system in order to add them to the classpath.

In case a Library depends on system libraries, put these dependencies next to the .jar file. For example, Processing's opengl.jar Library depends on JOGL hence the DLLs (for Windows) or jnilibs (for OS X) have to be located next to the opengl.jar file.

What is the difference between JDK and JRE?

JDK stands for Java Development Kit whereas JRE stands for Java Runtime Environment. For developers it is recommended to work with a JDK instead of a JRE since more Java development related applications such as Javadoc are included. Javadoc is a requirement to properly compile and document a Processing Library as described on the guidelines page.

You can have both a JDK and a JRE installed on your system. In Eclipse you need to specify which one you want to use.

The JRE System Library

This primarily affects Windows and Linux users (because the full JDK is installed by default on Mac OS X). It is recommended that you use the JDK instead of a JRE. The JDK can be downloaded from Oracle's download site. Also see the Java Platform Installation page, which contains useful information.

To change the JRE used to compile your Java project:

  1. Open the properties of your project from the menu Project β†’ Properties. Select "Java Build Path" and in its submenu, click on the "Libraries" tab.
  2. A list of JARs and class folders in the build path will show up. In this list you can find the JRE System Library that is used to compile your code. Remove this JRE System library.
  3. Click "Add Library...". In the popup window, choose "JRE System Library" and press "Next".
  4. Select an alternate JRE from the pull-down menu or click and modify the "Installed JREs". Confirm with "Finish" and "OK".

Compiling with Ant and javadoc

Ant is a Java-based build tool. For more information visit the Ant web site. Ant uses a file named build.xml to store build settings for a project.

Javadoc is an application that creates an HTML-based API documentation of Java code. You can check for its existence by typing javadoc on the command line. On Mac OS X, it is installed by default. On Windows and Linux, installing the JDK will also install the Javadoc tool.

More Repositories

1

p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs β€”
JavaScript
20,599
star
2

processing

Source code for the Processing Core and Development Environment (PDE)
Java
6,437
star
3

p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
JavaScript
1,246
star
4

p5.js-sound

p5.sound brings the Processing approach to Web Audio and p5.js. Demos:
JavaScript
857
star
5

processing-android

Processing mode and core library to create Android apps with Processing
Java
765
star
6

processing-docs

[Deprecated] Processing reference, examples, tutorials, and website
HTML
370
star
7

p5.js-editor

Deprecated desktop editor for p5.js
JavaScript
337
star
8

processing-video

GStreamer-based video library for Processing
Java
272
star
9

p5.js-website

p5.js website built using Node.js, Grunt, YAML and Assemble
JavaScript
238
star
10

p5.js-video

JavaScript
175
star
11

processing-sound

Audio library for Processing built with JSyn
Java
138
star
12

processing-web-archive

Repository for the Processing.org web site, examples, reference, and dreams
HTML
128
star
13

processing-sound-archive

Archived Sound Library for Processing
HTML
125
star
14

processing-android-archive

Java
96
star
15

p5.accessibility

p5.accessibility.js makes the p5 canvas more accessible to people who are blind and visually impaired. It can be used with any p5.js sketch and it is used in the p5.js web editor.
JavaScript
74
star
16

processing-experimental

Experimental Mode for the PDE
Java
72
star
17

processing-templates

Library, Mode, and Tool templates
Java
60
star
18

p5.js-website-OLD

The website for p5.js.
JavaScript
60
star
19

Processing-Hour-Of-Code

Repository for an interactive one-hour Processing tutorial.
JavaScript
56
star
20

processing-website

Repository for processing.org
MDX
54
star
21

processing-eclipse

Eclipse plugin project for Processing
Java
50
star
22

processing-android-library-template

Processing Android Library Template for Gradle
CSS
32
star
23

processing-tool-template

Processing Tool Template for Eclipse
Java
27
star
24

p5.sound.js

new build of p5.sound.js library
JavaScript
26
star
25

processing-examples

Example files for "processing4" and "processing-website"
Processing
17
star
26

processing-pi-website

Files for the pi.processing.org subdomain that documents Processing on the Raspberry Pi
CSS
16
star
27

p5.js-getting-started-es

Spanish translation of Getting Started with p5.js
HTML
14
star
28

processing-design-system

Processing
10
star
29

processing4-javafx

JavaFX library for Processing 4
Java
10
star
30

processing-javadocs

I am testing the idea of using github pages for javadocs
HTML
7
star
31

p5.js-website-translator

Experimental web app to facilitate the p5.js website translation.
Vue
7
star
32

processing-forum-archive

Bugs and details about the Processing Forum: http://forum.processing.org
7
star
33

OSACC-p5.js-Access-Report

6
star
34

processing-library-template-gradle

Processing Library Template for Gradle and IntelliJ
Java
6
star
35

p5.js-showcase

JavaScript
6
star
36

p5.js-release

Holds the built, versioned releases of p5.js.
JavaScript
5
star
37

processing-community-day-website

The website for Processing Community Day
CSS
2
star
38

cardboard-wrapper-sdk

Wrapper Library for Google's Cardboard sdk for VR
C++
2
star
39

processing-gsoc

1
star
40

processing-doclet

Java
1
star
41

p5.js-example

GLSL
1
star
42

Processing-Foundation-GSoC

This repository is a central hub for all resources, project ideas, and guidelines related to the Google Summer of Code (GSoC) program at the Processing Foundation
1
star