• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

CurrentVersion problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am having a problem and am hoping someone else has been through this, and can perhaps provide some help.

When the application is compiled
javac SecondApp.java
only the disk prompt is returned, indicating a clean compile.

When the application is run
java SecondApp
The following message indicats three errors.
Registry key 'software\JavaSoft\Java Runtime Environment\CurrentVersion' has value '1.2', but 1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.

I have removed Jbuilder3.5 which used JRE 1.2.2.
The JRE resides in this directory C:\JDK1.3\JRE. I am assuming the JDK and JRE are compatible versions. Cannot find anything that actually states what JRE version is used.
Java.dll resides at both
C:\Program Files\JavaSoft\JRE1.3\bin
And
C:\jdk1.3\jre\bin
The java.dll files are the same size, and have the same modification dates.

My autoexec.bat has these paths -
SET PATH=%PATH%;C:\WINDOWS\Twain_32\Scanwiz;C:\WINDOWS\Twain\Scanwiz;c:\jdk1.3;c:\jdk1.3\bin;c:\JavaProjects
SET CLASSPATH=.\;C:\jdk1.3\lib\tools.jar
The CLASSPATH was added this morning, got the same message.
This is the program I am trying to run. It works fine as an application run from Forte 4 java, Community Edition, with a package statement. Original code is from Gilbert�s _SAMS Teach Yourself Java2 Online book
// SecondApp.java - adding a "Quit" button
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class SecondApp
{
JFrame theFrame = new JFrame("Your Second Application");
JButton theQuitter = new JButton(" Quit ");
public SecondApp()
{
Container c = theFrame.getContentPane();
c.add(theQuitter, "South");
theQuitter.addActionListener(new Quitter());
theFrame.setSize(300, 200);
theFrame.show();
}
public class Quitter implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
System.exit(0);
}
}
public static void main(String[] args)
{
new SecondApp();
}
}

Once again, any help would really be appreciated.
C. Lindstrom
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I ran into the same problem. You need to modify the Windows registry entry for JavaSoft.
WARNING ... this can be risky. Don't mess with anything else in the registry!!! Windows relies on it heavily and if you mess it up you'll end up having to do a complete re-install WARNING!!!
Now that I've scared you off ... I have done it and everything was ok. Just be very careful that you're in the right spot when you make the change.

  1. Click on Programs-Run
  2. Enter REGEDIT. You'll see a split pane window. On the left hand side
  3. Select HK_LOCAL_MACHINE
  4. Select Software
  5. Select JavaSoft
  6. Select Java Runtime Environment
  7. Now, on the right hand side you'll see 'Current Version' followed by "1.2"; change this to "1.3"
  8. Close the application

  9. Your Runtime should now be set to the correct version.
    Hope that helps.
    ------------------
    Jane
 
C Lindstrom
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jane,
Thank you so much for taking the time to reply. Followed your instructions, and it ran. HORRAY!
Really like your www pages. Will start working towards certification, and am planning on using your plan of attack.
Good luck on the exam.
Connie

Originally posted by C Lindstrom:
Am having a problem and am hoping someone else has been through this, and can perhaps provide some help.

When the application is compiled
javac SecondApp.java
only the disk prompt is returned, indicating a clean compile.

When the application is run
java SecondApp
The following message indicats three errors.
Registry key 'software\JavaSoft\Java Runtime Environment\CurrentVersion' has value '1.2', but 1.3' is required.
Error: could not find java.dll
Error: could not find Java 2 Runtime Environment.

I have removed Jbuilder3.5 which used JRE 1.2.2.
The JRE resides in this directory C:\JDK1.3\JRE. I am assuming the JDK and JRE are compatible versions. Cannot find anything that actually states what JRE version is used.
Java.dll resides at both
C:\Program Files\JavaSoft\JRE1.3\bin
And
C:\jdk1.3\jre\bin
The java.dll files are the same size, and have the same modification dates.

My autoexec.bat has these paths -
SET PATH=%PATH%;C:\WINDOWS\Twain_32\Scanwiz;C:\WINDOWS\Twain\Scanwiz;c:\jdk1.3;c:\jdk1.3\bin;c:\JavaProjects
SET CLASSPATH=.\;C:\jdk1.3\lib\tools.jar
The CLASSPATH was added this morning, got the same message.
This is the program I am trying to run. It works fine as an application run from Forte 4 java, Community Edition, with a package statement. Original code is from Gilbert�s _SAMS Teach Yourself Java2 Online book
// SecondApp.java - adding a "Quit" button
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class SecondApp
{
JFrame theFrame = new JFrame("Your Second Application");
JButton theQuitter = new JButton(" Quit ");
public SecondApp()
{
Container c = theFrame.getContentPane();
c.add(theQuitter, "South");
theQuitter.addActionListener(new Quitter());
theFrame.setSize(300, 200);
theFrame.show();
}
public class Quitter implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
System.exit(0);
}
}
public static void main(String[] args)
{
new SecondApp();
}
}

Once again, any help would really be appreciated.
C. Lindstrom


 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad it worked . Thanks for the kind words although I haven't taken the test yet so I'm not sure how my 'plan of attack' will work; I'm keeping my fingers crossed
------------------
Jane
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic