Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Why does Eclipse find error in simple "public static void main( String[] args) { } instruction?

Reply
Thread Tools

Why does Eclipse find error in simple "public static void main( String[] args) { } instruction?

 
 
Gianni Galore
Guest
Posts: n/a
 
      08-21-2011
Am I crazy? I setup just the most simple java program in a new v3.6.2 Eclipse java project:


package aaa.bbb;

public static void main( String[] args) {
System.out.println("hello");
}


And Eclipse thinks the line

public static void main( String[] args) {

contains already an error (indicating a white x on red dot). When hovering above the red ot the Eclipse tells me:

- Syntax error, insert ")" to complete SimpleMemberAbnnotation
- Syntax error on toker "]", invalid(
- ...

Hmm, whats wrong? Eclipse does not like the brackets after "String[]"

I guess its a wrong Eclipse setting for the Java project but which?

I use J2SE v1.6upd26 under Win7

Gianni

 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      08-21-2011
On 8/21/2011 10:41 AM, Gianni Galore wrote:
> Am I crazy?



Possibly. I'd suggest consulting a mental health professional if you're
concerned about it. (j/k)

Also, most Java programmers know that methods can't be bare, they need
to be enclosed in a class definitions. Two seconds with the Java
tutorial would have reminded you.

> package aaa.bbb;
>


public class Main {

> public static void main( String[] args) {
> System.out.println("hello");
> }


}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between void proba(); and void proba(void); ??? PencoOdStip@gmail.com C++ 1 05-23-2007 07:12 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
what is the difference, void func(void) and void fucn() noblesantosh@yahoo.com C Programming 5 07-22-2005 04:38 PM
"void Method()" vs "void Method(void)" Ollej Reemt C++ 7 04-22-2005 03:47 AM
`void **' revisited: void *pop(void **root) Stig Brautaset C Programming 15 10-28-2003 09:03 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57