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!

Recommended Answers

All 11 Replies

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

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

Wow. Thanks a lot!!!

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

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?

just console project.

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

thank you peter_budo!!!

If this is solved can you please click on link below last post "Mark this Thread as Solved".

Thanx

yep, of course!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.