Hi guys.
I've just installed libnetty-java package on my ubuntu
$ sudo apt-get install libnetty-java

and then try compile this code

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
...

It throws this error:

javac QuoteOfTheMomentClientHandler.java
QuoteOfTheMomentClientHandler.java:1: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.ChannelHandlerContext;
^
QuoteOfTheMomentClientHandler.java:2: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.ExceptionEvent;
^
QuoteOfTheMomentClientHandler.java:3: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.MessageEvent;
^
QuoteOfTheMomentClientHandler.java:4: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
^
4 errors
neo@neo-desktop:~/workspace/java/mynetty1$ javac QuoteOfTheMomentClientHandler.java
QuoteOfTheMomentClientHandler.java:1: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.ChannelHandlerContext;
^
QuoteOfTheMomentClientHandler.java:2: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.ExceptionEvent;
^
QuoteOfTheMomentClientHandler.java:3: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.MessageEvent;
^
QuoteOfTheMomentClientHandler.java:4: package org.jboss.netty.channel does not exist
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
^
4 errors

How to fix this?
Do I need specify some path to find netty library or install some extra packages?

Thanks in advance!

Obviously you are missing library that does provide all the stuff your imports are trying to use. Therefore you need to add either the JAR file for the library to your project or add new dependency in your pom.xml if you using Maven. You can get either of them here

Edited 6 Years Ago by peter_budo: Typo

I've downloaded the files, thank you peter_budo. Can you guide me how to install these files?
I've tried extract .jar file and copy whole extracted folder to my project path. It works. Is it correct way doing it?

You need only netty-3.23.Final.jar , which is in netty-3.2.3.Final/jar folder, this you will add into your "res" folder of your project. Every IDE has it own specific way how to add resources. I made a blog entry some time ago how to do it for NetBeans and IntelliJ IDEA. You can find it here

Edited 6 Years Ago by peter_budo: n/a

Do I need extract netty-3.2.3.Final.jar to my project folder?
And META-INF folder is necessary?

Edited 6 Years Ago by _neo_: n/a

No extracting for JAR file. Sometimes libraries in ZIP format have to be extracted otherwise no.

META-INF not sure, what type of project you building? GUI/Web?

I don't have res folder, should I create one and copy .jar to that folder?

This question has already been answered. Start a new discussion instead.