Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
  • Piet Souris

The canonical source-in-Eclipse setup

Ranch Hand
Posts: 41
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At roughly the same time (a few days earlier) than I posted a hack method of using JForum with Eclipse on CodeRanch, the maintainer of JForum2 posted his own guide on the JForum2 site.

Some work has been done on the site (either by Google or the maintainer), which has for a while made it hard to source these links. The install directions are in a JForum2 site attached to the side of whatever is currently running as the main site (*not* on the wiki). This link currently leads to the board itself, and the posts are sticky at the top,

You need the "JForum2 Developer Quick-Start Guide",

This is fairly awe-inspiring piece of work, screenshots into a .docx. You may prefer to follow that, or the below, or swap between them if there are any unclear points,

  • Hassle in setup. Requires gear installed on the host computer, in Eclipse, some outside commandlines, and more.

  • Pros
  • Cannonical method of getting JForum running repeatable, and buildable in most circumstances.

  • This method should (I've not tried...) be able to check out any revision, but then the hack method (see below) may be as useful or better.This method is likely best for those wanting to contribute to source, or have formal requirements for coding process.

    For those wanting to hack, have a look at the hack method too. The hack method flattens the folder layout, separating out the webapp/ and src/ folders. This may be your preference, or not...


    Install a JRE
    The JForum2 instructions have several steps for importing a JRE. However, JForum is known to run on modern JREs, including OpenJDK, and most installs of Eclipse will include either a JRE and/or full JDK, so those instructions are skipped here. If you have problems, or simply need Java installed, refer to the JForum2 instructions.

    Install Maven/Java in the environment
    Maven/Java is needed on the host computer. Up-to-date packaging will likely be ok (I understand JForum, even Jforum2, has not much need of the cutting edge).

    Get an ojdbc-14 .jar
    This setup requires the database driver. This is presumably not published in Maven repositories, so needs individual downloading,
    Aggravatingly, not only is this .jar not in repositories, but it is protected by "Sign up!" notices. It might be sourced elsewhere (I did)?

    As Maven will be looking for this code, this needs to go in the Maven repository. Use the following commandline,
    > mvn install:install-file -Dfile=ojdbc14.jar -DartifactId=ojdbc14 -Dversion= -Dpackaging=jar

    If Eclipse doesn't have one, install a subversion plugin
    There are two,
  • Subclipse
  • Subversive

  • SubEclipse comes from the subversion coders and is reputedly stable, Subversive is more advanced but reputedly less stable. That's all I can tell you. I tried SubEclipse,
    Help > Marketplace

    Search for "subeclipse" or "maven", Press the little 'install' button.

    (For SvnEclipse) Add native support for svn and Java
    Subversion must be installed on the host environment, not just internally in Eclipse. Also, SubEclipse uses native libraries via an adaptor. If you use packaging, you may be in luck. For example, apt-get distros have,

    You can just hunt for JavaHL, that should find required packaging.

    If Eclipse doesn't have one, install a Maven plugin

    Most Eclipse version - Eclipse Java EE IDE - comes with one. Check under,
    Help > About

    If not, follow the instructions above and get,

    Help > Marketplace.

    Import source via SVN and the Eclipse plugin
    File > Import > Checkout Projects from SVN

    Leave the next panel with the radio checked as,
    "Create a new repository location"

    On the following panel, set the URL for download. The URL use depends on your needs for JForum?...

    The panel following that should show automatically the folder tree of the subversion download,

    Select the root folder and click "Finish"

    Now the source code tree should be imported into Eclipse.

    Make Maven build from .pom locally
    In Eclipse, on the left panel, should be the newly created project,

    Right click the 'jforum2' entry, then,
    Preferences > JavaEE Integration > Enable Project Specific Preferences

    Set a runtime launch for Maven
    Run > Run As > Maven Build

    Then set,
    Goal = "package"

    And untick "Skip tests",

    Now, that run configuration can be applied and run, either immediately or by selecting from the menus under "Run".

    [Thumbnail for eclipse_jforum_svn_checkout.png]
    Checkout via svn plugin in Eclipse
    [Thumbnail for eclipse_jforum_maven_runconfig.png]
    Simple Maven runconfig for Eclipse
    and POOF! You're gone! But look, this tiny ad is still here:
    Low Tech Laboratory
      Bookmark Topic Watch Topic
    • New Topic