• Post Reply Bookmark Topic Watch Topic
  • New Topic

needing some beginner help  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new at this. I am trying to teach myself Java. I have some tutorials that I'm going through for beginners and I have also downloaded Dr>Java for the compiler. I am having trouble after compiling to view the end result. Its a basic Hello World program. Its giving me an error " Static Error: Undefined name 'java.Hello' ". Just wondering whats happening I have typed in the correct code just not sure what's going on.
This is the code.

public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World");
System.out.println("I am learning Java");
}
}
 
Ranch Hand
Posts: 85
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see no reason why this code shouldn't compile, because I ran it just now and it compiled. Make sure you save it with Hello.java since it's a public class. Take your time time because you're close.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Mabe wrote:I have also downloaded Dr>Java for the compiler.


You don't want to use that. Start with a simple text editor or programmer's editor, such as UltraEdit, and compile and run on the command line. Save the IDEs for when you're further along. Using one now will just lead to more confusion.

Start here: http://docs.oracle.com/javase/tutorial/getStarted/cupojava/index.html
 
Jason Mabe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, maybe I just need to use a different compiler? I also downloaded the javaSE 7u3. I'll try the suggested compiler site and see if that makes a difference.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Mabe wrote:Thanks, maybe I just need to use a different compiler?


Yes. The command line compiler, javac, that comes with the JDK downlaod.

I've never heard of this "compiler" Dr Java that you're referring to, but I'm assuming it's an IDE, which you definitely don't need yet.
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

We have an FAQ which I think will explain everything for you. Use the jdk7u3 compiler you downloaded from the Oracle site.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!