File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Need Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need Help" Watch "Need Help" New topic
Author

Need Help

William Hipschman
Greenhorn

Joined: May 16, 2005
Posts: 4
Hey guys, I went to Barnes and Noble yesterday with my uncle and I bought HeadFirst Java. I love this book! I'm am only 12 but I am fascinated by computer programming. I know mostly pascal, which is how I got a kick-start at Java.

So... I need help.
When I go to compile a .java file, it returns this:
Registry key 'Software\JavaSoft\Java Runtime Enviroment\CurrentVersion'
has value '1.5', but '1.4' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Enviroment


Any ideas?

Thanks,
Wil
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30586
    
154

Wil,
Welcome to JavaRanch and welcome to Java! Head First Java is a great and entertaining book to learn from.

Are you using an IDE? If so, which one? (Eclipse, NetBeans, ...)

If you are compiling at the command line, try "javac *.java" to compile or javac -version to get your version number and post the results here.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
William Hipschman
Greenhorn

Joined: May 16, 2005
Posts: 4
Originally posted by Jeanne Boyarsky:
Wil,
Welcome to JavaRanch and welcome to Java! Head First Java is a great and entertaining book to learn from.

Are you using an IDE? If so, which one? (Eclipse, NetBeans, ...)

If you are compiling at the command line, try "javac *.java" to compile or javac -version to get your version number and post the results here.


Thanks Jeanne.

I put in "javac *.java" (no quotes) in at the command line, and got the same response returned.

No IDE, would you recommend getting one? (if so, which one?)

Thanks,
Wil
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

I wouldn't recommend an IDE yet. Once you get something like this figured out manually, you will be a long way toward understanding how IDEs work.

That said, I don't think that I've seen this particular problem before. What happens if you type
at the command prompt?
and
as well?
It looks like your compiler and the runtime are actually different versions.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
Maybe you should download the Sun SDK 1.4 or 1.5 and (re)install it. It looks like something is wrong in your registry.
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
It's been a while, but I got a message similar to this when I had version of Java installed. My JAVA_HOME environment variable "pointed to" one version but the other was first in my PATH.

What values do you have for these? Since you already have a Command Prompt window up, do this:
> echo %JAVA_HOME%
> echo %PATH%
(The >'s are the prompts; don't type them.)

What do you get?

Also, do you know how to run the registry editor? At a command prompt type...
> regedit

Go to HKEY_LOCAL_MACHINE/Software/JavaSoft. Is there a "Java Runtime Environment" there? If so what's in it?

In your Control Panel, do you have Java icons? If you open it/them, do you see any version numbers?

And lastly, if you go to Control Panel/Add or Remove Programs, what Java or J2xx items do you have?

Between all these bits and pieces I'm sure we can hammer this out.

Ryan
William Hipschman
Greenhorn

Joined: May 16, 2005
Posts: 4
Ok here is my current version:


And here is what I get from SET PATH...and from echo %PATH% as well...


When I enter echo %JAVA_HOME% , it just returns %JAVA_HOME% (makes sense, sorta)


Entering in regedit results in this being returned...



HKEY_LOCAL_MACHINE\Software\Javasoft at the command line returns...




And I tried finding the directory, no luck.



Yes I have Java icons in the CP, it tells me the same exact version as typed before.



The Java items at add/remove programs are.....

J2SE Runtime Enviroment 5.0 Update 2
Java 2 Runtime Enviroment, SE v1.4.2
Java 2 Runtime Enviroment, SE v1.4.2_03
Java 2 Runtime Enviroment, SE v1.4.2_08
Java 2 SDK, SE v1.4.2_08


And thats it.....

Any more ideas?

Thanks,
Wil
Aly Gilani
Greenhorn

Joined: Jul 20, 2004
Posts: 7
Hi William,

It seems that you have a couple of different runtime environments and a SDK. The SDK is 1.4 but the runtime environment is 1.5.

I think you should remove all the current installations of java (SDK and JRE) and download the SDK from java.sun.com (The SDK includes JRE)

Hope that helps.

Aly
William Hipschman
Greenhorn

Joined: May 16, 2005
Posts: 4
Thanks Aly,

I removed every Java application I have and went ahead and downloaded the Java 2 SDK 1.4.2 With Net Beans. I figured it would be better just to download it all at once.

So now I'm waiting for this to finish downloading, then install it.

I'll keep you guys posted.

Thanks for all your help everyone,

Wil
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30586
    
154

Wil,
Whether you use NetBeans or not, there isn't any harm in having it on the machine. I wasn't advocating using an IDE. In fact, it's better (and often easier) to learn at the command line. It's just that the error you got is one that sometimes IDEs give and I wanted to help narrow down the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Help