Closed fhocutt closed 10 years ago
The readme contains actual Examples for reading/writing mediawiki content an links to code examples in test. Also a dependency copy section is provided. Can you give me an example, where are you looking for? What is missing for a java developer?
If you are looking for a getting started with maven try this Maven in 5 Minutes
https://github.com/eldur/jwbf/pull/26 addresses this.
Today I've been trying to get a project containing the sample code and the given snapshot dependency to compile and run, and while it finally compiles, I now find it throws a runtime exception with java.lang.NoClassDefFoundError
. There might be something wrong with the classpath although it is very unclear from online resources and the people I talked to.
My very basic sample code is here: https://github.com/fhocutt/jwbf-test/tree/master .
Once I get this running, I plan to improve the README and include step-by-step descriptions of how to get the sample code to run in the higher-level developerDoc that I'm writing.
Does it make more sense to reopen this or file another bug? I'm relatively new to Java but not to programming, and if I'm having this much trouble getting even a very simple bot to run using the instructions in the README, someone who's less experienced would have an even harder time.
For me everything is fine ... I tried
$ git clone https://github.com/fhocutt/jwbf-test && mvn clean test
and your mainclass works without a NoClassDefFoundError.
Do the versions of the system libraries match at compile and runtime? In Eclipse 1.5 is the default.
They do. Java version info:
$ java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)```
Maven version info:
$ mvn --version Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.7.0_55, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.16.0-031600rc2-generic", arch: "amd64", family: "unix"
On Wed, Aug 13, 2014 at 7:01 AM, lorinczz <notifications@github.com> wrote:
> Do the versions of the system libraries match at compile and runtime? In
> Eclipse 1.5 is the default.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/eldur/jwbf/issues/23#issuecomment-52051624>.
>
I prefer the latest version from oracles hostspot ... I'm not sure if there are some problems with OpenJDK on ubuntu64 (or other OSs)
The following combinations are tested:
More information on what I tried is in this gist: https://gist.github.com/fhocutt/0221c1a35265ce7cda33
try if my pull request will work (this is more java/maven releated, and has nothing with this lib :wink:).
mvn clean test
has the following output
Running opw.jwbf.app.JavaBotTest
Hello JWBF!
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
HITCHHIKER'S GUIDE TO THE GALAXY FANS
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.543 sec
(If you are not interested in a logging system you can ignore the warnings from SLF)
But it depends on your target application how to package and execute it.
A simple use case could be a "jar with dependecies", so you can run your java application like
$ java -jar yourTool.jar
and do not have create the CP manually. Is this interesting for you?
(btw: IDEs like eclipse/intellij/... have maven integrations out of the box, so you can run main classes easier ) (btw: the exec-plugin in build section can be used to call build related external tools)
New users will find it easier to get started if there are step-by-step instructions for installation for use/development.