Win a copy of Head First Android this week in the Android forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Intelliji Compiles but will not run

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello fellow JavaRanchers,

I just switched to the IDE Intelliji and created a package file under the source file. The problem is now while building runs 100% I am having issues of not being able to run the java file as it's greyed out. This picture should lead to some clues.


RunningIssue
 
Master Rancher
Posts: 4055
56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you say is grayed out here - looks like the standard IntelliJ display of a class, in "Darcula" mode. . To run the class you're looking at, you can just locate the little green triangle in the margin to the left of your main method, and click on it.  The first option that appears should be "Run Words.main()" - click that.  And you should be running.
 
Jenny Flair
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've tried running main but my main driver is named differently than main. The green triangle is greyed out and when I try to run it through the menu I get an edit:configurations with nothing highlighted.
 
Mike Simmons
Master Rancher
Posts: 4055
56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've posted a picture that shows green triangles that are not grayed out.  Perhaps you could post a picture that shows what you're describing?  And what does "my main driver is named differently than main" mean?  Do you mean a main method.  Again, the picture you posted shows a main method that is named main.  (More specifically, "public static void main(String[] args)".) . That looks like a valid main method, which is why your picture shows green triangles.  If you've renamed it to something else, it may not be a main method anymore, and that may be why you now have something grayed out.  Please post a picture that shows what you're actually dealing with now.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
create a simple IDEA theme and earn!
https://plugins.jetbrains.com/contest/intellij-themes/2019
reply
    Bookmark Topic Watch Topic
  • New Topic