Results 1 to 6 of 6
- 09-16-2008, 11:33 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 40
- Rep Power
- 0
Hello World in linux returns undefined reference to `main' collect2: ld return
Hello. I'm getting really stressed out about the fact tht i cannot compile the most simply program of all! I keep on getting errors, And all i've done is copy and paste source code, jus so i know tht my java complier is working!
-----SOURCE-----
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello, world!\n");
}
}
----ERROR----
javac '/home/photek/Desktop/HelloWorld.java' /usr/lib/gcc/i586-suse-linux/4.3/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
.
Could some1 please help me :-(. i start my uni course next week and i want to get things atlease working.
Honestly people your help will mean the world to me.
Thanks
- 09-17-2008, 12:16 AM #2
What version of the JDK are you using? I don't recognize the error message from the javac command.
What is the path/file that follows the source file on the commandine you show?
/usr/lib/gcc/i586-suse-linux/4.3/../../../crt1.o
- 09-17-2008, 12:51 AM #3
Member
- Join Date
- Sep 2008
- Posts
- 40
- Rep Power
- 0
I've sorted it :-D. I ad to pass arguments to main to get it work :-D via the terminal.
Thanks for the reply tho!
- 09-17-2008, 02:47 AM #4
I guess I was confused. I thought you were having problems compiling. Passing args to main sounds like executing.
But HelloWorld doesn't take args???
- 09-17-2008, 07:11 PM #5
Member
- Join Date
- Sep 2008
- Posts
- 1
- Rep Power
- 0
- 04-06-2009, 10:10 PM #6
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
[SOLVED] Windows Linux conflict - TrayIcon image not display in Linux
By Eranga in forum Advanced JavaReplies: 6Last Post: 04-08-2009, 04:05 AM -
[SOLVED] JNI gives Error undefined Symbol, do I miss an Headerfile?
By hannehomuth in forum Advanced JavaReplies: 2Last Post: 07-03-2008, 01:43 PM -
Getting the Object Reference Name
By Deathmonger in forum New To JavaReplies: 2Last Post: 03-12-2008, 02:51 PM -
Calling a Jython script from a Java Servlet returns incomplete output
By bthakur in forum Java ServletReplies: 0Last Post: 11-13-2007, 12:41 PM -
exception in thred main java.lang.nosuchmethoderror: main
By fernando in forum Java AppletsReplies: 1Last Post: 08-06-2007, 09:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks