Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Java class files for tomcat, where?(Web server development learning issue.)
Java class files for tomcat, where? [message #1735581] Tue, 21 June 2016 10:11 Go to next message
Jens Andersson is currently offline Jens AnderssonFriend
Messages: 4
Registered: June 2016
Junior Member
Learning web server programming (java, tomcat) using the tutorial found on jsptut.com. When I come to 'Beans and Forms Processing' I run into trouble: Where in the project should I store the java class UserData.java definition file? And how to compile it within Eclipse? Finally, where should teh UserData.class file go?

A working solution found by trial-and-terror is to store the .java file under Java Resources/src/<package name>, mark the .java file and hit Run. This creates a .class file in the build/classes/<package name> directory. I copy this .class file to WEB-INF/classes and restart the server.

I run Eclipse Mars.2, JDK 1.8 and Tomcat 8 on a CentOS 6 host.

/jason
Re: Java class files for tomcat, where? [message #1735612 is a reply to message #1735581] Tue, 21 June 2016 12:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30305
Registered: July 2009
Senior Member
It's probably better to ask on the Web Tools forum. Maybe this helps:

http://stackoverflow.com/questions/30905947/how-to-compile-and-run-a-jsp-beans-project-using-eclipse


On 21.06.2016 08:22, Jens Andersson wrote:
> Learning web server programming (java, tomcat) using the tutorial
> found on jsptut.com. When I come to 'Beans and Forms Processing' I run
> into trouble: Where in the project should I store the java class
> UserData.java definition file? And how to compile it within Eclipse?
> Finally, where should teh UserData.class file go?
>
> A working solution found by trial-and-terror is to store the .java
> file under Java Resources/src/<package name>, mark the .java file and
> hit Run. This creates a .class file in the build/classes/<package
> name> directory. I copy this .class file to WEB-INF/classes and
> restart the server.
>
> I run Eclipse Mars.2, JDK 1.8 and Tomcat 8 on a CentOS 6 host.
>
> /jason
Re: Java class files for tomcat, where? [message #1735740 is a reply to message #1735612] Wed, 22 June 2016 11:24 Go to previous message
Jens Andersson is currently offline Jens AnderssonFriend
Messages: 4
Registered: June 2016
Junior Member
Ed Merks wrote on Tue, 21 June 2016 12:33
It's probably better to ask on the Web Tools forum.


Maybe. Actually I have found at least one working solution: When creating a new class in the package folder, the type should be Servlet, not Class. Another workaround (if type is set to class) is to copy the .class file (found in the build folder) to the WEB-INF/lib folder.

Any comments on that are most welcome.

Quote:

Maybe this helps:

http://stackoverflow.com/questions/30905947/how-to-compile-and-run-a-jsp-beans-project-using-eclipse


Seams to me like another problem.

/jason

[Updated on: Wed, 22 June 2016 11:25]

Report message to a moderator

Previous Topic:Regexp MULTILINE mode to find & delete a multi line XML stanza
Next Topic:Unfortunately (app name), Stopped.
Goto Forum:
  


Current Time: Thu Jul 18 13:03:01 GMT 2019

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

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

Back to the top