Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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


Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Main program not giving output" Watch "Main program not giving output" New topic
Author

Main program not giving output

Ritika Saxena
Ranch Hand

Joined: Jul 02, 2006
Posts: 51
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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
Sheriff

Joined: Oct 13, 2005
Posts: 41531
    
  31
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: 14655
    
  25

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