Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

eclipse editor does not contain main type

 
shihab K Bava
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear friends,

When I tried to run the above vlas from eclipse I got an error "editor does not contain main type". But when copy the class to another package it works fine. Any clues?

THe main point is I am trying to run some demo applications. All libraries and jar files are there in my systesm and path and classpath variable are correct. But when I am tryign to run a class which have main,, it gives the same error. So that I created a test class (above class) and tried to run. When that class in the package demos.texture it gives error. But when the test class copied to another package it works fine. Any one can help?

Thanks and Regards
Shihab
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to select/open the class file in the editor and bring it to front before to run it. If you tabbed/switched to another class file in the editor, then this one will be runt. If this one doesn't have a main method, you will get this error.
 
Sp Sandhu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also i tried a SWT demo code that earlier gave this error with this main inialization>
public static void main (String [] args) {

notice the space b/w String & []

so i replaced with

public static void main (String[] args) {

and it worked
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!