Jump to content

New to java

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1
thatsme

thatsme

    Programmer

  • Members
  • PipPipPipPip
  • 176 posts
Hi, i am using eclipse-sdk-3.5 When i compile this program, it prints hello world, but before that table which has "Errors exist in required project(s): HelloWorld Do you want to proceed with launch?" written in itself is shown. What's wrong? Source code file is named HelloWorld.java

class HelloWorld {

public static void main (String args[]) {
System.out.print("Hello world");

}

}

#2
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
probably the arguments. the right way would be

public static void main(String[] args)

#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
:confused: How could I not see that? I thought it was an eclipse failure as i didn't see any errors xD

#4
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
hehe this shiZnit is confusing specially if you're programming in different languages... but I don't think that eclipse would have any fails when it comes to Java as it is kind of the main thing in eclipse....Eclipse´s development tool for C/C++ on the other hand does failr pretty hard from time to time... both with error messages and as discovered I/O bugs ))

Edited by Roman Y, 18 September 2010 - 02:50 PM.


#5
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
*Googles 'shiZnit'* :D

#6
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
Da hallowack shiZnit that happens inside yo briZZle! :D

#7
thatsme

thatsme

    Programmer

  • Members
  • PipPipPipPip
  • 176 posts
Tanks for help

#8
thatsme

thatsme

    Programmer

  • Members
  • PipPipPipPip
  • 176 posts
I was too quick with thanking. Program works well on windows vista, but the same error still arises on xp even if i type String[] args instead of String args[]

#9
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
Put this in HelloWorld.java

public class HelloWorld {
     public static void main(String[] args) {
          System.out.println("Hello world");
     }
}
Still error?
Java is totally OS independent, unless you hardcode some OS-specific things like fileseparators etc. So your program should work on Vista as well as on XP. Especially "hello world" program. The error is in somewhere else.

Quote

Tanks for help
I'll take three. :)

#10
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
oh right miss that one as well...
the program needs to know that the class is public.... See sinipull´s code ))