Installation of Jetty into Eclipse - eclipse

I've had Jetty recommended as a good container for fast and simple development, in my case, Java Server Faces. I wish to use it with my Eclipse IDE (Version: 3.4.1), but quite frankly, can't figure out how.
I've tried various outdated plugins, only with large amounts of errors in return, so I'm hoping someone could guide me from downloading the right version to installing it, and being able to press "RUN", and see a simple Hello World in JSP/JSF work.
Cheers.

I use the Run Jetty Run plugin. Its very simple and easy to use

You could follow that tutorial from the eclipse help pages.
But check the version of your jetty. From this thread, V6 is recommended (V9 would work too, from Jacob's comment).
I believe the J2EE Preview server is hard coded to that internal Eclipse supplied version of Jetty.
However, you can execute "Window -> Preferences" and on the "Server -> Server Runtime Environments" page, click the Add button. Click the "Download additional server adapters" link and a dialog should appear and eventually list a Jetty Generic Server Adapter you can try.

I have followed the below steps to set up Jetty server in my eclipse:
(1) Download the 'net.sourceforge.eclipsejetty.launcher' jar (plugin) from the below URL:
http://sourceforge.net/projects/eclipse-jetty/
(2) Copy the downloaded jar file to your eclipse 'plugins' folder (Example: C:\eclipse-jee-luna\plugins)
(3) Restart Eclipse
(4) Go to Eclipse Workspace -> Right click on your web project -> Run -> Run Configurations -> Jetty Web App -> Set the 'WebApp Directory' -> Click on Run
After following the above steps, I am able to successfully deploy & run my web project using Jetty Server in Eclipse.
I hope this is helpful.

Related

Dynamic web project missing in STS

I am facing one issue with Spring tool suite 4, I don't see "Dynamic web project" option. I want to create one dynamic web project but I do not find this option in my Spring tool suite. How to install those external tool in Spring tool suite, however I got few link i.e http://download.eclipse.org/releases/mars for eclipse, should I use this link for Spring tool suite as well?
Solve this issue in Spring Tool Suite 4
Tested with 4.15.1 RELEASE
Go to Help -> Install New Software..
Enter eclipse software repo link (https://download.eclipse.org/releases/latest) in Work with input box.
You will get the list of available software. Filter the list by searching for Java EE related software. Search something like "java ee" to make things easier.
Choose Eclipse Java EE Developer Tools from the filtered list and proceed further with installation.
You may need to restart the STS IDE to install the update properly.
To solve this on STS 4.x.x
Go to Install New Software.
Select the main Eclipse update site for 2019-03 ( if not added, you must click o add button and paste this URL: http://download.eclipse.org/releases/2019-03 on both fields)
search for m2e-wtp There are four extensions showing up and you should install the ones you prefer.
Restart your IDE
see https://github.com/spring-projects/sts4/issues/96#issuecomment-484522744 on martinlippert comment
https://github.com/spring-projects/sts4/issues/96#issuecomment-484522744
Short version: fixed in Spring Tools 4.2.2 (coming in late May 2019), workaround is to install the m2e-wtp features from the main Eclipse update repo into an existing Spring Tools 4 for Eclipse install.
If you dont see dynamic web project in File->New and also in other
Then go to help -> install new software
copy paste this http://download.eclipse.org/releases/mars/ and click enter
if it is the first time then it take lot of time to download depends upon the internet
Once it get started downloading a pop will appear as trust click on that
After downloading make sure to restart STS and check whether dynamic web project is showing or not
check in file->new or else check in Others

Adding Tomcat into Eclipse

I am trying to add a tomcat server into runtime environments. I successfully installed tomcat. I already have Java EE eclipse, BUT after I click search under Window->Preferences->Server->Runtime environments and select apache tomcat and then click OK a window with the following text popups: No new server runtime environments were found. What am I doing wrong? I thought after switching to Java EE and installing tomcat I will be able to add the RE... Many thanks in advance!
After trying to add the RE: no tomcat servers list!!!
after trying to search (C:/Program Files/Apache...)
and finally the popup after choosing "apache software foundation" and hitting ok
You need to specify the server runtime in that window. From the browse button, select the base path of the directory where you have installed tomcat and hit next. Hopefully that should do it. There should also be an option to download and install, if you have internet connectivity.
If you dont see any server types in the 'add new Server' dialog, then you are probably missing the server adapters. In which case click on the 'Download additional server adapters' link. This will allow you to pick and download 'tomcat server adapter'. Once that is done.
Some screenshots etc would also help in understanding and helping you resolve your issue.
Hope this helps.
Run time environment click on add button select Apache tomcat-> Click on next button -> Browse the Tomcat 7.0 path -> Finish.
Because you are not having JST server adapters...you are not able to see installed apache in eclipse ....just install this through 'install new software' in help menu ....
You are most likely are missing the Eclipse Tomcat Server Feature. You can either try reinstalling all of the WTP plugins or maybe install Spring STS which I'm sure has the plugin installed.

How do I create a Jetty Server in Eclipse Juno?

This is what I've done so far:
From "Install New Software", I chose the site: "http://eclipse-jetty.sourceforge.net/update/"
Installed "Eclipse Jetty Feature".
Restarted Eclipse after the installation.
However, Jetty does not show up in the list of servers in the New Server wizard.
Any ideas what I'm doing wrong here? I'm a complete newbie to Java. I'm a C# programmer and I'm learning to use Eclipse and such. Sorry if I'm missing something obvious.
UPDATE 1
Screenshot of New Server > Download additional server adapters
If I attempt to install the server adapter, I see this error message during the installation:
UPDATE 2
Screenshot of Installed software
Screenshot of New Server Wizard
Screenshot of Run Configurations
Screenshot of Preferences > Run/Debug > Perspectives
Can you confirm Eclipse Jetty Feature is installed?
Help -> Install New Software > what is already installed?
Then to run Jetty you can add it in the Run Configurations or Debug Configurations under Jetty Webapp
Quick tutorial (you don't need the "Run Jetty Run" plugin)

Running jetty from eclipse

Please let me know how can I configure jetty server to run from eclipse IDE?
Also, suggest me some good plugins for the same. I downloaded jetty launcher but not able create new configuration with it. Please help.
The best way I found to run Jetty from eclipse (and debug, etc.) was this : http://neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration/
Basically, you create a java project, put jetty's code in it, create a context file in jetty/contexts that points to your web application, and Run as Java application.
No need for a plugin.
With Eclipse Kepler, I found two plugins, "Eclipse Jetty" and "Run Jetty Run" in the
market place.
I tried "Run Jetty Run" first but couldn't make it work (css file didn't load), but with
"Eclipse Jetty", it worked out of the box for my project.
I have followed the below steps to set up Jetty server in my eclipse:
(1) Download the 'net.sourceforge.eclipsejetty.launcher' jar (plugin) from the below URL:
http://sourceforge.net/projects/eclipse-jetty/
(2) Copy the downloaded jar file to your eclipse 'plugins' folder (Example: C:\eclipse-jee-luna\plugins)
(3) Restart Eclipse
(4) Go to Eclipse Workspace -> Right click on your web project -> Run -> Run Configurations > Jetty Web App > Set the 'WebApp Directory' > Click on Run
After following the above steps, I am able to successfully deploy & run my web project using Jetty Server in Eclipse.
I hope this is helpful and easy to set up.

Debugging a tomcat project in Eclipse 3.4.2

I downloaded eclipse 3.4.2 and tried installing tomcat plugin (version 3.2.1)for eclipse from sysdeo (http://www.eclipsetotale.com/tomcatPlugin.html)
I have followed installation instructions but when is start tomcat from eclipse toolbar i got the following error
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:205)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)
I did follow troubleshoot instructions but no success.
I tried to putting plugin in dropin directory too but still got the same error.
This was working fine in eclipse 3.2 and 3.3
Then I tried using standard inbuilt WTP to set up my tomcat server. I am not sure how it will pick my server.xml in conf directory of tomcat, it seems it is not picking as of now.
How do I associate my eclipse project with this setup. I am able to start the server but when i browse the tomcat start page, it does not show anything.
I would appreciate if someone can provide some ways to fix this.
Thanks in advance.
-Dipesh
After trying out few things I was able to debug tomcat project in eclipse 3.4.2
To debug tomcat application/project using eclipse 3.4.2 use WTP plugins which are installed along with it.
Go to Window --> Show View --> Others --> Server
In this view create a new server, please select tomcat installation directory and version information.
Then double click on Tomcat VX.X Server at local host, it opens up configuration settings page
In the Server Locations Section select "Use Tomcat Installation (takes control of Tomcat Installation) and enter deploy path.
In the publishing section select Never Publish automatically and uncheck update context path checkbox.
Voila!! All set to debug tomcat project in eclipse 3.4.2
There is no need to download and copy any extra plugin.
Thanks Juri. Hope this helps.
I'm using Tomcat with Eclipse Java EE version with WTP and it works perfectly. I have Ant scripts which deploy my web app to the tomcat webapp folder. In order to debug, you have to open the Server view in Eclipse, add a new server and choose the correct Tomcat version. Once that's done, open the configuration of Tomcat within eclipse by double-clicking on the server entry in the Eclipse server view you just created. On the left-middle side of the confguration page you should see something like "let Eclipse control the native Tomcat installation", I don't remember the exact text now. You have to choose that. Then you can set a breakpoint in your source code and then start Tomcat in debug mode from within Eclipse's server view.
Hope that helped.
If you are using the Sysdeo plugin, then you don't want to also be using the standard Eclipse WTP servers. To use the Sysdeo plugin, you need to have already downloaded and extracted a standard zipped tomcat directory. Make sure to define CATALINA_HOME in your path. Then, assuming you've correctly installed the sysdeo plugin, go into Eclipse->Windows->Prefs->Tomcat (this is Sysdeo's Tomcat settings, and not the WTP settings). You need to tell the plugin where you've extracted your Tomcat directory, and set it to use Context files.
Now create a new Dynamic web project. Right click it, and go into its properties->Tomcat.
Check it as a 'Tomcat Project'. Give it a context name, and also tell it the directory which would be the base of your war (by default, Eclipse has named this WebContent, I believe). Apply it and close the Window. Right click again your project, and go to the Tomcat section. Add the 'Tomcat Libraries to Build Path' so you can use the Servlet/JSP classes. Finally, click on 'Update Context'. If you go into your Tomcat directory under Conf, you'll see that the plugin has created a context for you that points to your Eclipse workspace. No need for deploying the app to the Tomcat directory. Now, you should be able to click on the Sysdeo Tomcat 'start' button, and your app should be able to connect to your app at localhost:8080/context_name.
HTH,
Bill
Using the excellent Findjar web page for:
org/apache/tomcat/util/log/SystemLogHandler
gives the following:
Information on class org.apache.tomcat.util.log.SystemLogHandler:
Containing JAR files:
jbossweb.jar
gwt-dev-windows.jar
tomcat-util-3.3.2.jar
tomcat-util-4.0.6.jar
tomcat-util-4.1.31.jar
tomcat-util-4.1.34.jar
tomcat-util-4.1.36.jar
tomcat-util-5.0.16.jar
tomcat-util-5.0.18.jar
tomcat-util-5.0.28.jar
tomcat-util-5.5.12.jar
tomcat-util-5.5.15.jar
tomcat-util-5.5.23.jar
tomcat-util-5.5.4.jar
tomcat-util-5.5.7.jar
tomcat-util-5.5.9.jar
tomcat-util-5.5.7-alpha.jar
tomcat-util-5.5.8-alpha.jar
tomcat-util-5.5.9-alpha.jar
Ensure the appropriate jar file is in your CLASSPATH.