Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » WTP no longer auto generates class files?(eclipse servlet class file)
icon5.gif  WTP no longer auto generates class files? [message #659313] Sat, 12 March 2011 04:30 Go to next message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Hi all,
I tried to use wtp to develop web application.
I created a new dynamic web project.
I wrote a Servlet by myself.
Then I ran the servlet, but it showed the following message:
java.lang.ClassNotFoundException
I can't find the class file under "build/classes".
But I can see the jsp web page.
I wonder if anyone here can tell me how to make eclipse auto generate these class files for me.
I also tried to export the war file.
And I failed to see the servlet.
I could see that there's classes folder under "WEB-INF".
But the folder is empty..
Any hint is welcome. Sad

[Updated on: Sat, 12 March 2011 17:17]

Report message to a moderator

Re: WTP no longer auto generate class files? [message #659314 is a reply to message #659313] Sat, 12 March 2011 04:33 Go to previous messageGo to next message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Kun Niu wrote on Fri, 11 March 2011 23:30
Hi all,
I tried to use wtp to develop web application.
I created a new dynamic web project.
I wrote a Servlet by myself.
Then I ran the servlet, but it showed the following message:
java.lang.ClassNotFoundException
I can't find the class file under "build/classes".
But I can see the jsp web page.
I wonder if anyone here can tell me how to make eclipse auto generate these class files for me.
I also tried to export the war file.
And I failed to see the servlet.
I could see that there's classes folder under "WEB-INF".
But the folder is empty.
Any hint is welcome. Sad

BTW, I'm using Eclipse Helios. And I downloaded the latest Enterprise package from the eclipse website. I'm using Tomcat 6.0.

[Updated on: Sat, 12 March 2011 04:43]

Report message to a moderator

Re: WTP no longer auto generate class files? [message #659348 is a reply to message #659314] Sat, 12 March 2011 16:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Kun,

It's good to try to keep your related messages in a single thread rather
than as top-level posts. (I guess the forum web page makes it easy to
mess that up.)

Normally, Project->Build Automatically is enabled (checked) by default,
but maybe it got turned off somehow?


Kun Niu wrote:
> Kun Niu wrote on Fri, 11 March 2011 23:30
>> Hi all,
>> I tried to use wtp to develop web application.
>> I created a new dynamic web project.
>> I wrote a Servlet by myself.
>> Then I ran the servlet, but it showed the following message:
>> java.lang.ClassNotFoundException
>> I can't find the class file under "build/classes".
>> But I can see the jsp web page.
>> I wonder if anyone here can tell me how to make eclipse auto generate
>> these class files for me.
>> I also tried to export the war file.
>> And I failed to see the servlet.
>> I could see that there's classes folder under "WEB-INF".
>> But the folder is empty.
>> Any hint is welcome. :(
>
> BTW, I'm using Eclipse Helios. And I downloaded the latest Enterprise
> package from the eclipse website.
Re: WTP no longer auto generate class files? [message #659351 is a reply to message #659348] Sat, 12 March 2011 16:56 Go to previous messageGo to next message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Hi Ed,
Really appreciate your reply.
I'm sorry for the inconvenience I caused.
In fact, I checked "auto generate" option several times.
I tried to "check" it or "uncheck" it.
I also tried to "close-run" or "restart" eclipse.
None work for me.
In fact, I think eclipse compiles the code for me.
If I delete an import library, eclipse will detect and show me the error.
Can I manually generate the class file if I can't find the class file?
I found that Netbeans can do it.
But I can't find such function in eclipse. Sad
Another problem I found that this happens only on my Windows7 platform.
Eclipse works for me on Linux platform.

[Updated on: Sat, 12 March 2011 17:05]

Report message to a moderator

Re: WTP no longer auto generate class files? [message #659359 is a reply to message #659351] Sat, 12 March 2011 20:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Kun,

It's Auto Build on the Project menu we're talking about, right? The
Build All action is also on the project menu. If you look at the
project's Properties's Java Build Path, you can determine what the
output folder is...


Kun Niu wrote:
> Hi Ed,
> Really appreciate your reply.
> I'm sorry for the inconvenience I caused.
> In fact, I checked "auto generate" option several times.
> I tried to "check" it or "uncheck" it.
> None works for me.
> In fact, I think eclipse compiles the code for me.
> If I delete an import library, eclipse will detect and show me the error.
> Can I manually generate the class file if I can't find the class file?
If it's building (and showing errors) the .class files must be going
somewhere already.
> I found that Netbeans can do it.
> But I can't find such function in eclipse. :(
Re: WTP no longer auto generate class files? [message #659363 is a reply to message #659359] Sat, 12 March 2011 22:02 Go to previous messageGo to next message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Hi Ed,
Yes. I checked and unchecked "auto build" from the menu several times. I also restart eclipse several times in hope of that eclipse can automatically generate the class file for me. But I failed. I also tried "Clean" the project in hope that eclipse can generate the class for me. But no matter what I do, I can't find the final class file. I don't want to change the ouptput folder.Sad

[Updated on: Sat, 12 March 2011 22:02]

Report message to a moderator

Re: WTP no longer auto generate class files? [message #659367 is a reply to message #659363] Sat, 12 March 2011 23:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Kun,

You looked at the Java Build Path as I suggested? Where does it say the
..class should be going? You've checked there? Note that the Project
Explorer filters out the folders that are the target of the build path,
so that will making finding the .class files hard. You can use the
basic Navigator view to show all the files including the ones in folders
that are filtered out. They must be ending up somewhere...

Kun Niu wrote:
> Hi Ed,
> Yes. I checked and unchecked "auto build" from the menu several times.
> I also restart eclipse several times in hope of that eclipse can
> automatically generate the class file for me. But I failed. I also
> tried "Clean" the project in hope that eclipse can generate the class
> for me. But no matter what I do, I can't find the final class file. :(
Re: WTP no longer auto generate class files? [message #659368 is a reply to message #659367] Sat, 12 March 2011 23:40 Go to previous messageGo to next message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Hi Ed,
Thanks for keeping an eye on my post.
I really looked at the output folder which should be "build\classes" using Windows Explorer.
But the folder is empty.
If I package my class, I can see that the package folders are generated.
But the folder has no class file in it.
I didn't use eclipse's explorer to see the files.
I had already filtered class file there.
That's why I consider it really strange and annoying. Sad
Re: WTP no longer auto generate class files? [message #659371 is a reply to message #659368] Sat, 12 March 2011 23:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Kun,

As I said, they must be going somewhere so look high and low for files
named *.class or look for a particular one Foo.class you know must
exists because you have a Foo.java. The windows explorer could search
the whole workspace for you.


Kun Niu wrote:
> Hi Ed,
> Thanks for keeping an eye on my post.
> I really looked at the output folder which should be "build\classes"
> using Windows Explorer.
> But the folder is empty.
> If I package my class, I can see that the package folders are generated.
> But the folder has no class file in it.
> I didn't use eclipse's explorer to see the files.
> I had already filtered class file there.
> That's why I consider it really strange and annoying. :(
Re: WTP no longer auto generate class files? [message #659372 is a reply to message #659371] Sun, 13 March 2011 00:23 Go to previous message
Kun Niu is currently offline Kun NiuFriend
Messages: 6
Registered: March 2011
Junior Member
Hi Ed,
Thank you for your focus on my problem.
Finally I found the cause of the problem.
I just updated my jdk to u24 and deleted u23 which is the original default jdk for my workbench.
Seeing from the error window, I can see that the class could not be built because of jre library error.
I reconfigured the jre library path. Now it works for me.
Thanks again for your replies. Smile
Previous Topic:XSD Graphical editor
Next Topic:JSP call the axis2 code generator
Goto Forum:
  


Current Time: Fri Dec 19 21:06:42 GMT 2014

Powered by FUDForum. Page generated in 0.01967 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software