File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Problem with javac and appletviewer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with javac and appletviewer" Watch "Problem with javac and appletviewer" New topic

Problem with javac and appletviewer

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello. I had the JDK 1.3.1_01 installed on Win 98 laptop. I, uninstalled, the JDK 1.3.1_01 (along with the same JRE) through control panel-> add/remove programs.
I, then, upgraded Win98 to Windows 2000 Professional and installed the Java 2 SDK 1.4.1_01 from I, also, installed the Java Runtime Environment (1.4.1_01) onto my Windows 2000 Professional operating system. I, then, went, into Control Panel, System/Advanced/Environment Variables, and created a JAVA_HOME user environmental variable pointing to:
and a PATH user environmental variable, in which, I put:
Now it works for "java" command from the command line, but "appletviewer" and "javac" give the following error:
C:\Java Programs>javac
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.4', but '1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.
I fixed it by creating a "SET PATH=c:\j2sdk1.4.1_01\bin" in my autoexec.bat, but I am forced to run autoexec.bat, everytime I invoke the command prompt (which is very annoying).
If anyone can help me with this, I would be very grateful.
Sincerely yours,
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Your Windows Registry is confused.
You can go into Start/Run/Regedit.exe, then go to HKEY_LOCAL_MACHINE/SOFTWARE/Javasoft and there is a JDK and JRE setting in there that can be manipulated. If your JRE has both a 1.3 folder and a 1.4 folder, Look at the JRE level folder and see what the setting is for CurrentVersion. Just edit it to an acceptable version.
PS: If you are using a bat file to set the path on the fly (which I do quite often instead of messing with the windows registry) put the thing in a file other than autoexec.bat. I have a p13.bat file that sets my path and classpath to 1.3, and a p14.bat that sets it to 1.4. Open a Dos session and execute the appropriate one on the fly.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Problem with javac and appletviewer
It's not a secret anymore!