[JAVA] Importing Jars [message #836573] |
Wed, 04 April 2012 16:44 |
Eugenio Bargiacchi Messages: 3 Registered: April 2012 |
Junior Member |
|
|
Good morning everybody, I'm having a little bit of trouble using java libraries in Eclipse.
More specifically, every time I include a jar in my project, I can import it just fine in the code, and everything will compile just fine, but as soon as I test what I did I get a java.lang.NoClassDefFoundError.
As I understand, this exception is caused by some classpath issues. However, it appears to me ( but as I am new I'm surely making some mistake ) that everything is correct.
To add a .jar to a project I right-click on my project, Build Path->Configure Build Path..->Libraries Tab, and then I click on Add External Jars.
This adds the jars into the Libraries folder ( is it a folder? it has a different icon, like books ).
Are there some steps I am missing to make the whole thing work?
Thanks in advance.
|
|
|
|
|
|
Re: [JAVA] Importing Jars [message #837314 is a reply to message #836573] |
Thu, 05 April 2012 14:02 |
|
On 4/4/2012 10:44 AM, Eugenio Bargiacchi wrote:
> Good morning everybody, I'm having a little bit of trouble using java
> libraries in Eclipse.
>
> More specifically, every time I include a jar in my project, I can
> import it just fine in the code, and everything will compile just fine,
> but as soon as I test what I did I get a java.lang.NoClassDefFoundError.
>
> As I understand, this exception is caused by some classpath issues.
> However, it appears to me ( but as I am new I'm surely making some
> mistake ) that everything is correct.
>
> To add a .jar to a project I right-click on my project, Build
> Path->Configure Build Path..->Libraries Tab, and then I click on Add
> External Jars.
>
> This adds the jars into the Libraries folder ( is it a folder? it has a
> different icon, like books ).
>
> Are there some steps I am missing to make the whole thing work?
>
> Thanks in advance.
Is this a Dynamic Web Project? In addition to adding the JAR via Build
Path, you'll need to add it to the Deployment Assembly. While you're in
Build Path, look over at the left column just above Build Path.
|
|
|
|
Re: [JAVA] Importing Jars [message #838042 is a reply to message #837971] |
Fri, 06 April 2012 13:29 |
|
On 4/6/2012 5:19 AM, Eugenio Bargiacchi wrote:
> @David Wegener
> Thanks, I've managed to create a new configuration but I can't seem to
> find a way to assign it to a specific project. Instead it appears
> directly in my Run menu.
>
> What I'd like ( if it is possible ) is to assign a configuration to a
> project so that when I run it, the server automatically gets configured
> as the configuration assigned to the project. Is this possible or do I
> have to create different servers?
>
> @Russel Bateman
> It is a Vaadin Project. Adding the jars to the Build Path of the project
> ( via Configure Build Path -> Libraries -> Add External JARs ) and to
> the configuration of the server ( via Run Configurations.. -> Classpath
> -> User entries ) seems to work now. What is the Deployment Assembly?
> I've seen the menu and it shows me two entries ( /src | WEB-INF/classes
> and /WebContent | / ), but I'm not sure I know what they mean.
>
> Sorry for being a newbie =)
I can't say. I know nothing of Vaadin (a web application framework). So,
if it works, then don't sweat it. What you're doing is a web
application; normally you'd ask questions in the Eclipse web tools
forum. I don't know if you'll fare better there, but you might try.
Otherwise, you really should find help in the Vaadin community. In fact,
that's probably the place to start.
|
|
|
Powered by
FUDForum. Page generated in 0.03281 seconds