Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Running an HTML file in Eclipse
icon5.gif  Running an HTML file in Eclipse [message #531231] Tue, 04 May 2010 09:17 Go to next message
Dayaan2010 is currently offline Dayaan2010Friend
Messages: 4
Registered: May 2010
Junior Member
I want to know how could I run 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 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 #531346 is a reply to message #531231] Tue, 04 May 2010 15:08 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
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
Re: Running an HTML file in Eclipse [message #531378 is a reply to message #531346] Tue, 04 May 2010 16:38 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 #531479 is a reply to message #531296] Wed, 05 May 2010 08:03 Go to previous messageGo to next message
Dayaan2010 is currently offline Dayaan2010Friend
Messages: 4
Registered: May 2010
Junior Member
My file is in a project but my project doesn't associate with a server.
How should I do it?
Re: Running an HTML file in Eclipse [message #531596 is a reply to message #531479] Wed, 05 May 2010 13:46 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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
Re: Running an HTML file in Eclipse [message #531637 is a reply to message #531479] Wed, 05 May 2010 16:10 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
"Dayaan2010" <a.kazimi@pndream.com> wrote in message
news:hrr8oh$k3g$1@build.eclipse.org...
> My file is in a project but my project doesn't associate with a server.
> How should I do it?
> --
> www.dayaan.com
> www.howview.com

If you just want to view the file in a web browser, right click on the file
in your project, select Open With->Web Browser.
icon14.gif  Re: Running an HTML file in Eclipse [message #534427 is a reply to message #531596] Wed, 19 May 2010 07:22 Go to previous messageGo to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
Messages: 47
Registered: May 2010
Member
I just wanted to say that I'm having success with the Vogella tutorial you referenced. I had to go *very* slowly to make sure I was doing things right (a couple parts, had to do twice). But so far, I have taken what was originally a "Classic" Galileo Eclipse download, and added functionality that has allowed me to run my first Servlet (completing about 2/3rds of the tutorial).
Cannt start tomcat Re: Running an HTML file in Eclipse [message #534816 is a reply to message #531596] Thu, 20 May 2010 12:51 Go to previous messageGo to next message
hayashi is currently offline hayashiFriend
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 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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
Previous Topic:launching multiple external programs
Next Topic:Plug-in Development - Singleton Issue
Goto Forum:
  


Current Time: Fri Apr 19 06:26:38 GMT 2024

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

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

Back to the top