• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get Error when try to compile and run Hellow Word

 
michele oer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I took java insruction over 3 years ago graduated and never used it. Now I need to edit someones code. I installed the j2eesdk-1_4_02 or windows xp and set my path. When I type "javac" at the command prompt I don't get errors and see Usage Java source file directories. But when I try to run a simple Hello Word program I see the following:

c:\javac HellowWorld.java

C:\>java Hello
The java class could not be loaded. java.lang.UnsupportedClassVersionError: Hell
o (Unsupported major.minor version 49.0)
 
Marilyn de Queiroz
Sheriff
Posts: 9064
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michele. Welcome to JavaRanch.

It looks like you have more than one version of the j2sdk installed.

What happens if you type c:\>javac -version

What happens if you type c:\>javac -J-version

(javac -version works in Java 5)

Also, I suggest that you put C:\j2sdk1.4.2_08\bin at the BEGINNING of the PATH variable instead of the end.
 
Kristin Stromberg
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also make sure that the class name you're trying to run matches the class name you've actually compiled. In other words use,
(it looks like you might have typed java Hello by accident).
[ October 07, 2005: Message edited by: Kristin Stromberg ]
 
michele oer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marilyn de Queiroz:
Hi Michele. Welcome to JavaRanch.

It looks like you have more than one version of the j2sdk installed.

What happens if you type c:\>javac -version

What happens if you type c:\>javac -J-version

(javac -version works in Java 5)

Also, I suggest that you put C:\j2sdk1.4.2_08\bin at the BEGINNING of the PATH variable instead of the end.
 
Marilyn de Queiroz
Sheriff
Posts: 9064
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what were your results?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic