How to setup tomcat with Eclipse? - eclipse

I've been spoiled by .NET development and this is driving me NUTS.
I am on Galileo.
Installed the WTP.
Installed tomcat 6 through the windows installer.
If I go (in eclipse) to Window --> Preferences --> Server --> Runtime Environment I get no tomcat option at all, as in a number of tutorials - only a basic folder with the useless J2EE Runtime Library.
What am doing wrong?
Any help appreciated!

Did you install Eclipse with the J2EE development tools also? There are different version of Eclipse you can download, the standard version only comes with J2SE tools.
You should see a Tomcat folder which allows you to choose the installation folder of the version of tomcat that you choose.

Related

Eclipse kepler SR 2 and Websphere

I have installed webspehere Application Server on my machine.
I have also installed Eclipse kepler SR 2.
I want to create a websphere profile, however in Eclipse I don't see 'Websphere' under Windows->Preferences->Servers-> ?
I am not sure if I am missing any plugin?
You need to download WebSphere Developer Tools to your Eclipse. WDT support 3 latest versions of Eclipse, so at this moment (17.10) - Mars, Neon and Oxygen, although it usually works with older also. You will need Eclipse for Java EE developers.
The easiest way is either start from this page Download Liberty in Eclipse or just find WDT via Eclipse Marketplace.
If you plan to develop for traditional WebSphere you will find server tools here - WebSphere Developer Tools for Eclipse Oxygen.

Glassfish Tools plugin for Eclipse Luna SR2 not working

I always install Glassfish Tools using Eclipse Marketplace or just downloading additional adapters in Eclipse Servers > New > Server.
For some reason, when moving from Eclipse Luna SR1 to SR2, the new plugin doesn't install the adapter (the "New Server" window doesn't shows Glassfish as an option), and when trying to manually download the Glassfish adapter, clicking at Download additional server adapters..., the Glassfish adapter is not shown.
Is there any bug in this version?
Something has changed in Oracle that the plugin is not available?
Make sure that you are running Eclipse with Java 8. The latest version of GF Tools for Eclipse requires Java 8 to run. You can still compile your projects with an earlier version of Java, if that's necessary.
To check the version of Java that you are running, go to Help -> About -> Installation Details -> Configuration.
To force Eclipse to use a particular JRE install, edit eclipse.ini file and add the following two lines at the start of the file:
-vm
[path-to-jre]

How to use Tomcat 8 in Eclipse?

EDIT 2014-02-07: Eclipse Luna is here, and support for Tomcat 8 is included in the bundled WTP : ) Happy days!
Tomcat 8 is still in development, but you can get it here. Now there is a RC version on the main Apache Tomcat page. Update 2/27/14: 8 is released now, and adapters built for WTP, just not integrated into eclipse bundles yet. Soon!
In Eclipse Kepler though, there is no supported adapter in the add server list for Tomcat 8. the Tomcat 7 adapter doesn't work, and it doesn't look like there's a new extension for it to download in the "Install new Extension" dialog.
Is my only option to get it (Tomcat 8) running locally outside of Eclipse and maybe hook a remote debugger into it for stepping through code? Will that even work for Eclipse Kepler + Tomcat 8? IntelliJ IDEA 12 couldn't do it in the 30 minutes of time I put into that path.
If you're wondering why I'm trying to do this at all, I'm playing around with Spring 4.0.0.M1 and 4.0.0.M2 WebSocket stuff. They (per Rossen Stoyanchev's Spring 4.0 blog post and examples) use JSR-356, which is implemented in Tomcat 8, theoretically to be back-ported at some point to Tomcat 7.
An answer to the broader question of "How can I easily get a development environment going for Spring 4 WebSocket support?" would be nice, but it would also still be nice to know how to plug in unsupported web servers to Eclipse.
Cheers,
E
**Update 8/7/13 - Rossen Stoyanchev updated the Spring 4.0.0.M2 blog and added some jpda wisdom and shared that yeah, he's using remote debugging:
That said, it's not very hard to debug with Tomcat 8 inside Eclipse. Just change the last line in bin/startup.sh to be (note the addition of "jpda"):
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$#"
Inside Eclipse create a remote debugging configuration for localhost port 80, launch it after starting Tomcat, and you can put breakpoints in the source code.
Thanks Rossen!
**Update 9/29/13 - Eclipse Kepler SR1 just arrived, but alas! No WTP support for Tomcat 8. Tomcat 8 is up to RC3.
**Updates 12/5/13
Blog url fix.
Tomcat 8 up to RC5.
Bug to track WTP fix in Eclipse to support Tomcat 8 HERE.
IntelliJ IDEA new version 13 says it now supports Tomcat 8. Haven't tried yet personally.
UPDATE: Eclipse Mars EE and later have native support for Tomcat8. Use this only if you have an earlier version of eclipse.
The latest version of Eclipse still does not support Tomcat 8, but you can add the new version of WTP and Tomcat 8 support will be added natively. To do this:
Download the latest version of Eclipse for Java EE
Go to the WTP downloads page, select the latest version (currently 3.6), and download the zip (under
Traditional Zip Files...Web App Developers). Here's the current link.
Copy the all of the files in features and plugins directories of the downloaded WTP into the corresponding Eclipse directories in your Eclipse folder (overwriting the existing files).
Start Eclipse and you should have a Tomcat 8 option available when you go to deploy.
I follow Jason's step, but not works.
And then I find the WTP Update site http://download.eclipse.org/webtools/updates/.
Help -> Install new software -> Add > WTP:http://download.eclipse.org/webtools/updates/ -> OK
Then Help -> Check for update, just works, I don't know whether Jason's affect this .
The only thing the eclipse plugin is checking is the tomcat version inside:
catalina.jar!/org/apache/catalina/util/ServerInfo.properties
I replaced the properties file with the one in tomcat7 and that fixed the issue for eclipse
In order to be able to deploy the spring-websockets sample app you need to edit the following file in eclipse:
.settings/org.eclipse.wst.common.project.facet.core.xml
And change the web version to 2.5
<installed facet="jst.web" version="2.5"/>
This should be a comment under the accepted answer, but I don't have 50 reputation yet.
At http://download.eclipse.org/webtools/downloads/
I first selected Released 3.5.2, which like others did not work for me.
Then I picked Integration 3.6.0, and saw Tomcat 8 for New Project of Dynamic Web Project.
I have tried below and it worked for me.
In eclipse go to Help->Eclipse Marketplace
Type JST extension in search box.
Install JSP Adapters for Luna
Restart the eclispe
You should be able to see Tocmat 8 server while adding new server.
In addition to #Jason's answer I had to do a bit more to get my app to run.
Download & unzip Eclipse IDE for Java EE Developers (Note the EE edition)
Download & unzip Eclipse's Web Tools Platform Stable (Milestone) 3.6+
Overwrite the two folders in the Eclipse IDE, with the WTP folder(s) (features & plugins folders)
Download and unzip Tomcat 8
In eclipse new -> other -> server -> Tomcat 8 (choose the unzipped location)
If you get a 404, click the Tomcat 8 in the Servers view -> Server Locations -> Change to Use Tomcat installation, and change the Deploy path: to webapps *
(If you can't edit this, delete any published webapps)
To add the Tomcat 9.0 (Tomcat build from the trunk) as a server in Eclipse.
Update the ServerInfo.properties file properties as below.
server.info=Apache Tomcat/#VERSION#
server.number=#VERSION_NUMBER#
server.built=#VERSION_BUILT#
server.info=Apache Tomcat/7.0.57
server.number=7.0.57.0
server.built=Nov 3 2014 08:39:16 UTC
Build the tomcat server from trunk and add the server as tomcat7 instance in Eclipse.
ServerInfo.properties file location : \tomcat\java\org\apache\catalina\util\ServerInfo.properties
The latest version of Springsource STS (3.6) supports Tomcat 8. It is based on eclipse Luna 4.4 and supports Java 8. Have at it!
Alternatively we can use eclipse update site (Help -> Install New Features -> Add Site (urls below) -> Select desired Features).
For Luna: http://download.eclipse.org/webtools/repository/luna
For Kepler: http://download.eclipse.org/webtools/repository/kepler
For Helios: http://download.eclipse.org/webtools/repository/helios
For older version: http://download.eclipse.org/webtools/updates/
Downloaded Eclipse Luna and installed WTP using http://download.eclipse.org/webtools/repository/luna
Downloaded Tomcat 8 and configured new server in Eclipse. I am able to setup tomcat 8 now in Eclipse luna
If you have untarred your own version of tomcat v8 with a root user into a custom directory (linux) then the default permissions on the TOMCATROOT/lib directory do not allow normal user access.
Eclipse will not be able to see the catalina.jar to check the version. So no amount of fiddling aorund with the server.properties will help!
just add chmod u+x lib/ to allow normal user access to the libs.

No "JavaEE" perspective even after installing Web,XML,... in "Eclipse-for Java Developers edition"

So the situation is like this ...I am having "Eclipse Indigo for Java Developers"....
and now i need to develop some web applications(dynamic web projects)..so i went to "Help" in eclipse menu :
Help > Install new software
and downloaded the whole bundle "Web,XML,JavaEE and OSGi Enterprise Development"...
but after that too there is no JavaEE perspective in eclipse..only java perspective..
I have checked in "Other" section too of perspective..but unable to find it..
What am i doing wrong here ??
I am on windows 7 ,64 bit and running android-sdk/tools perfectly !!
Unless you have a reason to stay on Indigo, you could just download and install the Juno version of "Eclipse IDE for Java EE Developers" (http://www.eclipse.org/downloads)
Keep your existing workspace (make a backup of it if you want). Install eclipse (unzip). Start eclipse and point it to your existing workspace.
If you installed plugins for eclipse Indigo, you will need to install them again for the Juno version.

eclipse indigo java perspective not visible

I installed Eclipse Platform Version: 3.7.2 on Ubuntu 12.04 LTS. My Ubuntu Software Center shows that Eclipse Extensible Tool Platform and Java IDE (eclipse 3.7.2-1) is installed. Also Eclipse Integrated Development is also installed (eclipse-platform 3.7.2-1). However when I launch Eclipse, I am not able to get a Java perspective and not able to create a Java project. When I click on Open Perspective: I see CVS Repository Exploring, Debug, Resource (default) and Team Synchronizing. Thanks in advance.
You can click open perspective > others and find Java perspective. please refer this picture:
First, you should not install Eclipse from any Linux repository or package manager; just download it directly from the Eclipse web site. Also make sure you're using the Oracle JDK, not gcj. There are many problem reported with running Eclipse under gcj. To specify the JVM for Eclipse to run in, use eclipse.ini
Second, what you have is the Eclipse Platform, which does not include any IDE features; it's just the base platform on which Eclipse is built (another problem with getting Eclipse from a linux repo is that you don't really know what they've packaged and delivered to you). For Java development, you probably want the Eclipse IDE for Java Developers or Eclipse IDE for Java EE Developers packages from the downloads page.
Close Eclipse and rename the .eclipse directory in your home directory with another name, for example .eclipseSAVE.
Restart Eclipse and in perspective you should find Java.