Home » Newcomers » Newcomers » Running an HTML file in Eclipse
|
Re: Running an HTML file in Eclipse [message #531296 is a reply to message #531231] |
Tue, 04 May 2010 12:59 |
|
On 5/4/2010 3:17 AM, Dayaan2010 wrote:
> I want to know how could I run an HTML file in Eclipse.
As long as your HTML file is in a project with which a server is
associated, you can run it just as you would any other file right-click
-> Run/Debug As -> Run/Debug on Server.
|
|
| |
Re: Running an HTML file in Eclipse [message #531378 is a reply to message #531346] |
Tue, 04 May 2010 16:38 |
|
On 5/4/2010 9:08 AM, Eric Rizzo wrote:
> On 5/4/10 5:17 AM, Dayaan2010 wrote:
>> I want to know how could I run an HTML file in Eclipse.
>
> Um, HTML files do not "run." Browsers can display them, if that's what
> you mean. What DO you mean?
>
> Eric
No, of course not, but "Run As" an HTML file in your project will launch
the internal browser on it for viewing purposes. Whether there is a more
correct way to do this inside Eclipse, I don't know, but this can be done.
|
|
| |
Re: Running an HTML file in Eclipse [message #531596 is a reply to message #531479] |
Wed, 05 May 2010 13:46 |
|
On 5/5/2010 2:03 AM, Dayaan2010 wrote:
> My file is in a project but my project doesn't associate with a server.
> How should I do it?
Uh, this is a bit long and it depends on what you've already got set up
in your environment.
1) Download a server. For example, Apache Tomcat. See
http://www.javahotchocolate.com/tutorials/setup-tomcat.html
2) Set this up inside Eclipse. Go to Windows -> Preferences -> Runtime
Environments and Add the newly downloaded Tomcat to Eclipse.
3) Right-click in the Package Explorer view, choose New, then Server
(might have to click first Other..., then find Server), then continue
through the dialogs to set up, e.g.: Apache Tomcat v6.0 Server.
4) Right-click your project, choose Build Path -> Configure Build Path,
then click on Server (in left pane). Click the Tomcat server in the
right pane.
5) Right-click on the JSP, Java class, or whatever it is you're trying
to run, then choose either Run As or Debug As, then Run on Server or
Debug on Server.
Going through a tutorial might help. Probably the latest tutorial on
JSP/servlet development is
http://www.vogella.de/articles/EclipseWTP/article.html It also covers
installation of Tomcat.
Best of luck,
Russ
|
|
| | |
Cannt start tomcat Re: Running an HTML file in Eclipse [message #534816 is a reply to message #531596] |
Thu, 20 May 2010 12:51 |
hayashi Messages: 1 Registered: May 2010 Location: Japan |
Junior Member |
|
|
I have a problem with Eclipse to start tomcat.
Please, teach me how to fix this problem.
(I am very very new to Eclipse environment.
Eclipse IDE version is 1.2.2.20100217-2310)
I downloaded Xampp and tomcat plugin to Xampp.
My files such as xxx.html, xxx.php and xxx.jsp can work properly by specifying URL in a browser http://localhost/xxx.html, http://localhost/xxx.php, and http://localhost:8080/xxx.jsp.
However, after I started using Eclipse, downloaded Eclipse and setup server environment as quoted below, the above files created newly in Eclipse environment can not work properly.
1) Download a server. For example, Apache Tomcat.
<<== I finished before installing Eclipse.
2) Set this up inside Eclipse. Go to Windows -> Preferences -> Runtime
Environments and Add the newly downloaded Tomcat to Eclipse.
<<== I did this, probably successfully.
3) Right-click in the Package Explorer view, choose New, then Server
(might have to click first Other..., then find Server), then continue
through the dialogs to set up, e.g.: Apache Tomcat v6.0 Server.
<<== I did this.
4) Right-click your project, choose Build Path -> Configure Build Path,
then click on Server (in left pane). Click the Tomcat server in the
right pane.
<<== In Libraries tab of Java Build Path, Apache Tomcat v6.0 is already added.
5) Right-click on the JSP, Java class, or whatever it is you're trying
to run, then choose either Run As or Debug As, then Run on Server or
Debug on Server.
<<== This encountered the error!!
When doing the above operation, apache and tomcat had been stopped from xampp control panel.
While Eclipse is trying to start tomcat, I got the error message below;
'Starting Apache Tomcat v6.0 at localhost' has encountered a problem.
Server Apache Tomcat v6.0 at local host failed to start.
The following is a copy of the error log;
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ja_JP
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
Error
Thu May 20 21:06:32 JST 2010
Server Apache Tomcat v6.0 at localhost failed to start.
Please teach me how to fix this problem.
Best regards,
Hayashi
|
|
|
Re: Cannt start tomcat Re: Running an HTML file in Eclipse [message #534846 is a reply to message #534816] |
Thu, 20 May 2010 13:18 |
|
On 5/20/2010 6:51 AM, hayashi wrote:
> I have a problem with Eclipse to start tomcat.
> Please, teach me how to fix this problem.
> (I am very very new to Eclipse environment.
> Eclipse IDE version is 1.2.2.20100217-2310)
>
>
> [snip]
Hayashi,
You're hijacking this thread for a different problem (though it's
obvious how you were tempted to do that) than the question that began
it. You should start a different one.
I can't answer on its relevance to XAMPP, but the best thing you can do
to learn how to set up Tomcat for use with Eclipse is to follow a
tutorial such as the one I noted. (Note that, while I know generally
what it is, I'm not specifically familiar with XAMPP.)
As far as XAMPP, I don't know what possible effect its control panel
could have on Tomcat running inside Eclipse: it's a different Tomcat,
right? It doesn't matter what you've got already running on your host,
running Tomcat inside Eclipse is a separate instance. The error you'd
likely get for doing that is one explaining that port 8080 is already in
use and you should eliminate the existing instance of Tomcat or change
the port number you use.
Based on your answers to my mini step-by-step, I could advise that
before right-clicking and launching your JSP, Java class or other file,
you should right-click on the Tomcat server in the Eclipse Server view
(pane) and choose Start.
Second...
What's wrong should appear in the Eclipse Console view (pane). The
contents of that view are what you should tell us here (if you need to).
Russ Bateman
|
|
|
Goto Forum:
Current Time: Fri Apr 19 06:26:38 GMT 2024
Powered by FUDForum. Page generated in 0.04592 seconds
|