Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

couldn't able to solve the problem!!

 
ramakrishna pydipati
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had java in my system it used to work properly,
but when I reformatted the system, I tried to load java again ,then I couldn't able to load it properly I am getting these errors!!
my java is in
JAVA_HOME:C:\Sun\AppServer\jdk;
CLASSPATH:C:\Sun\AppServer\jdk\bin;
Path:C:\Sun\AppServer\jdk\bin;
on command prompt:
if give command >java it's working properly;
but when I give "javac" I am getting the following errors
>javac
Error opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
 
Igor Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's installation problem,
It seems that you tried to restore files, likes java.exe...
But you have to reinstall java system in Windows
(to set also Windows registry, dll... and other things)
 
ramakrishna pydipati
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ,u r right
now I deleted every thing and started now I am getting a new error
i.e,
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
Press any key to continue . . .

I checked my path&classpath and JAVA_HOME everything is semms to be ok
can u help me out
Thanks in advance
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will you post the command that causes this error?
 
Srivani Nallan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the main function. You might have spelled it wrong in the method.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a new error
i.e,
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
Press any key to continue . . .
I checked my path&classpath and JAVA_HOME everything is semms to be ok

An improperly configured CLASSPATH will cause this problem. What is your CLASSPATH setting? Does it include the current working directory specified with a period?
Are you 100% certain that the HelloWorld.class file was generated during compilation?
 
roy joseph
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forgetting to include "." in your classpath can cause head-aches. one way to see if java installed properly is to run a class and explicitly stating its class path.
ex.
your class is here:
c:\java\hello.class
so run it like this:
java -cp c:\java\ hello
even if you are inside the directory where your class is present, without explicitly specifying the classpath you would get an error.
ex.
if you havent change your classpath to include the ".". doing this wont work.
c:\java\java hello
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic