aspose file tools*
The moose likes Cattle Drive and the fly likes Get Error when try to compile and run Hellow Word Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Get Error when try to compile and run Hellow Word" Watch "Get Error when try to compile and run Hellow Word" New topic
Author

Get Error when try to compile and run Hellow Word

michele oer
Greenhorn

Joined: Oct 07, 2005
Posts: 2
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

Joined: Jul 22, 2000
Posts: 9047
    
  10
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Kristin Stromberg
Ranch Hand

Joined: May 17, 2005
Posts: 91
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

Joined: Oct 07, 2005
Posts: 2
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

Joined: Jul 22, 2000
Posts: 9047
    
  10
So what were your results?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get Error when try to compile and run Hellow Word