jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Main program not giving output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Main program not giving output" Watch "Main program not giving output" New topic

Main program not giving output

Ritika Saxena
Ranch Hand

Joined: Jul 02, 2006
Posts: 51

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é

Joined: Nov 24, 2005
Posts: 14688

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.

[My Blog]
All roads lead to JavaRanch
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46412
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

Joined: Aug 16, 2005
Posts: 15094

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: Main program not giving output
It's not a secret anymore!