views:

39

answers:

1

Hello, Java newbie here.

I've downloaded the JAVA Eclipse IDE and started learning Java. I have a good experience with PHP, C, C++ and AS3 programming languages so the concep of OOP is known to me, now I've decided to learn and use Java.

I'd like to test some examples of Apache's MINA framework but I still can't figure out how to set up the MINA framework with Eclipse. First I've tried to copy the whole MINA 2.0 RC1 directory to my work directory, but now how can I use the framework?

Since I'm new to Java, I don't undestand very well the directory structure. In Eclipse I've created a new Java Project with the name "org.myself.server" since I guess this is the way code is structured in Java. Then I've created a package with the same name and the Class "TestServer" inside the package. I can code inside the main fuction of the class, compile, run and everything like a charm. But how do I use MINA inside my TestServer class? How do I import MINA and test the echoback server example?

Thanks very much for your time and my apologies about my english and newby questions.

A: 

In Eclipse you should modify the project properties to place the appropriate MINA jars on the project build path. Then, you should be able to use the MINA classes and it should build and run correctly.

pkananen
Hi Peter, thanks for your response. I copied the org folder on MINA source to the org folder in my project source. After the compiler complain about the lack of slf4j, I've downloaded the slf4j-1.6.1.zip and copied the org folder to my project source folder. After that, the compiler did not complain. So I coded the example (the code completion worked flawlesly on IDE) but when I've tried to run, I got the error "java.lang.UnsupportedOperationException: This code should have never made it into the jar". I've tried to add the jars on MINA dist to program path but no luck. Can you help?
Akira
You shouldn't be copying source over. You should be downloading the jars (you probably have), and actually be placing them on the build path by right clicking on the project in Eclipse, selecting 'Properties' and then going to Libraries and adding the jars.
pkananen
Thanks, it worked!
Akira