Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jaynano

macrumors newbie
Original poster
Aug 28, 2006
7
0
Hello everyone. I seem to be having an odd issue, at least it is odd to me, because I don't understand the cause of it. I can start a brand new java application project in Xcode, and no matter what I build the only thing I get when I run the program is "Hello World!" from my Xcode Run Log. If I make a new Java Class Library in xcode, it always initializes with my HelloWorld.java file in the src directory. Anyway, my issue is that I can't resolve this, and whenever I try to make new java applications I'm thwarted by the program I wrote a month ago saying "Hello World!"

please help if you know what's wrong.


Source Code:
import javax.swing.JOptionPane;

public class GameOfLife {
public static void main(String[] args){
JOptionPane.showInputDialog(null, "Input File Type");


}

}


resulting Log Output after compiling and running:
[Session started at 2006-10-05 17:43:28 -0400.]
Hello World!

GameOfLife has exited with status 0.
 

cblackburn

macrumors regular
Jul 5, 2005
158
0
London, UK
Set a breakpoint on the line of code with showInputDialog. Then launch the program in debug mode. Does the program ever execute the code? If not then you seem to have an incorrect entry point.

Chris
 

Krevnik

macrumors 601
Sep 8, 2003
4,100
1,309
Could be that you need to make sure that the 'manifest' is correctly pointing at the GameOfLife class for main() instead of the HelloWorld class?
 

iancapable

macrumors 6502
Oct 4, 2006
279
0
London, United Kingdom
jaynano said:
Hello everyone. I seem to be having an odd issue, at least it is odd to me, because I don't understand the cause of it. I can start a brand new java application project in Xcode, and no matter what I build the only thing I get when I run the program is "Hello World!" from my Xcode Run Log. If I make a new Java Class Library in xcode, it always initializes with my HelloWorld.java file in the src directory. Anyway, my issue is that I can't resolve this, and whenever I try to make new java applications I'm thwarted by the program I wrote a month ago saying "Hello World!"

please help if you know what's wrong.


Source Code:



resulting Log Output after compiling and running:

Use netbeans or eclipse hahaha

No seriously... Delete any .class files and then recompile, or do a clean and recompile? It's obviously not compiled the class correctly.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.