Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error when executing "java" command  RSS feed

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My friend just newly installed JRE v1.3.1. The installation process is successful, however, when he entered the command "java -version" at the command prompt, the following error occurred:


C:\>java - version
Error occurred during initialization of VM
java/lang/ClassNotFoundException: sun/io/ByteToCharMS950


I have never seen such error before, could anyone know how could I solve it?

Thanks.

Nick
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick,
I think he hasn't specify the path to the JDK that he installed in his system environment setting... It seems that the default JVM cannot be found...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ko Ko,

It might not be the case because the installation and configuration of JRE is automatic.

Anyway, do you know what params have to been specified?

Nick
[ March 31, 2005: Message edited by: Nicholas Cheung ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:
It might not because the installation of JRE is automatic.


Even though the installation is automatic, I even sometimes need to recheck the path in System Environment again and again to make sure that... Why don't you let him type that "java -version" in the JAVA_HOME/bin folder? If it is correct, then the problem might be with the System Environment... If not, it might be of JRE itself...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why don't you let him type that "java -version" in the JAVA_HOME/bin folder?

The same error for this arrangement.

Any other ways to check? It is because that installer is the only JRE that can be installed due to security reason.

Nick
 
Jeff Jetton
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:

"java/lang/ClassNotFoundException: sun/io/ByteToCharMS950"

I have never seen such error before, could anyone know how could I solve it?



Have you checked to see if that actual class (ByteToCharMS950) is actually sitting where it should be on your friend's computer?

And is it named correctly? Maybe the installer munged the name somehow (truncated to eight characters, or chopped off the ".class" extension, or something goofy like that).

I don't know, I'm just thinking out loud here...

- Jeff
[ March 31, 2005: Message edited by: Jeff Jetton ]
 
suresh koutam
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i had this problem too...
its definitly the classpath settings...
u know what...set the class path to the bin folder of Java and restart the computer.
i did it many times.....once u restart the cmptr...u will seee the difference...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its definitly the classpath settings...
u know what...set the class path to the bin folder of Java and restart the computer.

Do you mean this?

For example, my JRE is located at:
C:\Program Files\JavaSoft\JRE\1.3.1_02\

and what he needs to do is to:
set CLASSPATH = C:\Program Files\JavaSoft\JRE\1.3.1_02\bin;%CLASSPATH%;

But should it be set to a particular file or a directory is still fine?

By the way, why this case will happen? I never seen this before.

Nick
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set CLASSPATH = C:\Program Files\JavaSoft\JRE\1.3.1_02\bin;%CLASSPATH%;


I dont understand why one needs to set CLASSPATH to bin directory.

BTW, I found the above class inside of lib/rt.jar. Ask your friend to check whether the file exists.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pradeep.

I will let him try next week.

Nick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!