• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Main program not giving output

 
Ritika Saxena
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am running a very basic program using eclipse. When I click on run, the program runs fine but doesnot show any output on the console.

Here is my program:

package com.test;

public class OALTest {

public static void main(String[] args) {
System.out.println("Testing the OAL Class");
}
}

I am completely clueless as to what can be the problem in this case???
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like an Eclipse-related question, which should be asked in the IDE forum Anyway, are you sure you're executing this class, and not another. Right-click the source, select Run As -> Java Application.
 
Campbell Ritchie
Sheriff
Posts: 48381
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "console" do you mean a command prompt? You know that Eclipse doesn't use the "java" program, but something called "javaw" which doesn't use the command prompt? I ran your class and got the requisite output on Eclipse.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Eclipse, make sure the Console view is visible by selecting the menu Window / Show View / Console. Then run your application from Eclipse. The output should appear in the Console view inside Eclipse.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic