JavaScript File won't run in Eclipse

1,074 views
Skip to first unread message

jsu

unread,
Sep 3, 2012, 12:56:25 AM9/3/12
to eclipse-...@googlegroups.com
Hello everyone: 

  I am trying to run a javascript file using eclipse. 
  Eclipse Installed: Eclipse IDE for Java Developer
  Eclipse version: 1.4.2 (Indigo) install eclipse updates 3.7

  JavaScrpt development tool installed: eclipse javascript development tool version 1.3.2
  
  I created javascript project called: jscript_exer1
  then I add a file called exer1 under the project

  When I click on run button, it shows no lunch history, click on 'Run As' option,
  it shows none applicable
 

  Path: /jscript_exer1/exer1
  Type: file  
  file location C:\javascript\jscript_exer1\exer1

  The code in the file: 
  [code]
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html>
  <head>
   <title>JavaScript Exercise</title>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  </head>
 <body>
   <script type="text/javascript">
    document.write("Hello JavaScript!");
   </script>
 
 </body>
</html>

  [/code]

  I attached 2 pictures to show file structure in Eclipse and file structure on the local C drive. Please give me some advise on how to to make the file run in Eclipse. Thanks!

Andrew Wynham

unread,
Sep 3, 2012, 3:38:38 PM9/3/12
to eclipse-...@googlegroups.com
No need to run as...  Just open your file in a browser. You may need to rename to exer1.html to make it easier. 
--
===================================================
Visit us at:
http://groups.google.com/group/eclipse-pune-dev/
===================================================


--

--
Andrew C Wynham Jr.
Principal Consultant
TILT Development, Inc.
703.864.0247

jsu

unread,
Sep 3, 2012, 9:55:54 PM9/3/12
to eclipse-...@googlegroups.com
Hello Dee: 

 Thanks for the reply. I would like to know how to compile and run JavaScript by using Eclipse. Could you give me some suggestions?

Andrew Wynham

unread,
Sep 4, 2012, 2:24:57 AM9/4/12
to eclipse-...@googlegroups.com
You don't compile JavaScript. It is an interpreted scripting language that runs in a browser like Internet Explorer or Firefox. Simply open the HTML page you wrote in Internet Explorer to see it work. 
Reply all
Reply to author
Forward
0 new messages