Java class files for tomcat, where? [message #1735741] |
Wed, 22 June 2016 07:30  |
Eclipse User |
|
|
|
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 09:25   |
Eclipse User |
|
|
|
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 04:03  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03972 seconds