Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Java class files for tomcat, where?
Java class files for tomcat, where? [message #1735741] Wed, 22 June 2016 11:30 Go to next message
Jens Andersson is currently offline Jens AnderssonFriend
Messages: 4
Registered: June 2016
Junior Member
This question was posted in the Newcomers forum, see https://www.eclipse.org/forums/index.php?t=msg&th=1078579&goto=1735581&#msg_1735581. A comment suggested re- posting here.

Original post:

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 #1736030 is a reply to message #1735741] Fri, 24 June 2016 13:25 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1350
Registered: July 2009
Senior Member
On 6/22/2016 7:30 AM, Jens Andersson wrote:
> This question was posted in the Newcomers forum, see
> https://www.eclipse.org/forums/index.php?t=msg&th=1078579&goto=1735581&#msg_1735581.
> A comment suggested re- posting here.
>
> Original post:
>
> 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

For details about the Tomcat support in WTP, see the Tomcat FAC[1].
Though the information is rather old, it still applies.

Note that "publishing" is involved when running your Dynamic Web project
on a server. This "publishing" includes copying the classes under
"build/classes" to the "WEB-INF/classes" of the target publish location.
Since your class file is going to "build/classes", you are putting
your Java source in the right location. The "assembly" that occurs
during "publishing" is controlled by the Deployment Assembly page in the
project's Properties dialog.

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Java class files for tomcat, where? [message #1736084 is a reply to message #1736030] Sat, 25 June 2016 08:03 Go to previous message
Jens Andersson is currently offline Jens AnderssonFriend
Messages: 4
Registered: June 2016
Junior Member
Larry Isaacs wrote on Fri, 24 June 2016 13:25

For details about the Tomcat support in WTP, see the Tomcat FAC[1].
Though the information is rather old, it still applies.


Thanks for the link. It gave answers to other questions I have or have had.

Quote:

Note that "publishing" is involved when running your Dynamic Web project


Publishing my server fails. Lots of errors involving SVN directories. I have to run an old version of SVN (1.6.11) since I run it on CentOS 6 and haven't upgraded ...

/jason
Previous Topic:Tomcat v6.0 Not Starting In Debug
Next Topic:JSDT 2.0 official neon release seem to have some problems
Goto Forum:
  


Current Time: Tue Jan 16 07:45:40 GMT 2018

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

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