[java] What should my default class path directory be?
What should my default class path directory be?
I have just installed Visual J++, but when trying to run the following program:
public class Welcome {
public static void main( String args[] )
{
System.out.println( "Hello World!" );
}
}
I continue to get the message:
error J0051: Undefined package ''lang''
I just can not figue out what I am doing wrong.
Thanks,
·†§ Nick §† ·
Not 100% sure about the syntac (havn''t used Java in a long time) But I belive you are forgetting to ''import'' the proper packages so your classes know what they are doing... like forgetting C++''s , to begin a java program you need
import java.lang.*
import java.lang.math.*
something along those lines. Good luck!
import java.lang.*
import java.lang.math.*
something along those lines. Good luck!
Not 100% sure about the syntac (havn''t used Java in a long time) But I belive you are forgetting to ''import'' the proper packages so your classes know what they are doing... like forgetting C++''s , to begin a java program you need
import java.lang.*
import java.lang.math.*
something along those lines. Good luck!
import java.lang.*
import java.lang.math.*
something along those lines. Good luck!
java.lang.* is supposedly already imported by the compiler, but I tried the import (import java.lang.* as well, and still am getting the same error.
·†§ Nick §† ·
·†§ Nick §† ·
Hmmm, well for one don''t use Visual J++ to compile, it''s a decent editor but it compiles into a Microsoft version of Java. Go to java.sun.com and get the 1.3.1 compiler. When you install it, it should handle setting your default classpath.
And no, you should never need to import java.lang.*;
"If consquences dictate our course of action, it doesn''t matter what''s right, it''s only wrong if you get caught."
- Tool
And no, you should never need to import java.lang.*;
"If consquences dictate our course of action, it doesn''t matter what''s right, it''s only wrong if you get caught."
- Tool
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement