• Post Reply Bookmark Topic Watch Topic
  • New Topic

Just started� first obstacle� Please help  RSS feed

 
Girish Poojari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have recently installed J2SDK1.4.2_03.
Enviroment variable settings. :
JAVA_HOME C:\J2SDK1.4.2_03
CLASSPATH .;%JAVA_HOME%\lib\src.zip;
PATH %PATH%;%JAVA_HOME%\bin

I have wrote a simple java program as below.
public class Welcome1 {
public static void main(String args[])
{
System.out.println("Welcome to Java Programming!");
}
}
If I compile above code I am getting 100 error message and 206 warning message. Everyone of it says same thing
�Warning : as of release 1.4, assert is a keyword, and may not be used as an identifier.�
Can anyone explain me , what I am doing wrong ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Girish,
Welcome to JavaRanch!
Well, I can tell you one thing you're doing wrong, but it shouldn't cause those error messages. Your setting for CLASSPATH shouldn't include src.zip; the file you would want is %JAVA_HOME%\jre\lib\rt.jar . But actually, at the beginning, regardless of anything you've read anywhere else (which may have been based on some now obsolete information) you shouldn't have CLASSPATH set at all. Just remove that setting altogether, and trust me, you'll be happier. The JDK knows how to find its own classes just fine.
Now, as far as the error messages: let's see the command line you used to compile your program. It should have been just
javac Welcome1.java
I suspect you're supplying more arguments than this, perhaps asking the compiler to recompile the JDK source by accident.
 
Girish Poojari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jess,
Thanks for you prompt reply, I have deleted CLASSPATH and It has worked its magic.
Thanks again for your help
Regards,
Girish
 
Girish Poojari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ernest,
Please accept my apologies for referring you as �Jess�. I am new to this arena and hope you will forgive me for my stupid mistake.
Regards
Girish.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been called worse things!
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take it as a compliment -- I hear Jess is a great person.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!