Problem about Java(TM) 2 Runtime Environment.

Hi, I installed a program that uses JAVA RUNTIME ENVIRONMENT 1.4.2_05, I installed the jre also but when I start the program I get this java error. I did not change or add something to the classpath.

Exception in thread "main" java.lang.NoClassDefFoundError: java/awt/FocusTravers

alPolicy

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at com.cs.uid.renderer.java.components.WindowWrapper.<init>(WindowWrappe

r.java:23)

at com.cs.uid.renderer.java.components.MDIMainFrameWrapper.<init>(MDIMai

nFrameWrapper.java:36)

How can I solve the problem? I uninstall jre and the program but it did not work again, I am not sure but the problem maybe about the classpath settings I think. I installed 1.4.2_05 but when I run java -version in the prompt it says Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01). there is a conflict, can anyone hep me to solve the problem?

[1629 byte] By [carikana] at [2007-10-3 4:39:45]
# 1
1. Make sure you installed only one version of JDK and JRE2. Compile the java file(javac) before running it(java)Cheers
astelaveestaa at 2007-7-14 22:43:41 > top of Java-index,Java Essentials,New To Java...
# 2

> 1. Make sure you installed only one version of JDK

> and JRE

Nonsense. You can have as many as you like. Just make sure you're pointing to the one you want when you run.

> 2. Compile the java file(javac) before running

> it(java)

Assuming that the poster knew to compile the file, it sounds like you have a classpath issue. Make sure your class(es) and jars are in the classpath.

SoulTech2012a at 2007-7-14 22:43:41 > top of Java-index,Java Essentials,New To Java...
# 3

I understand from your words that I should arrange classpath values to java 1.4.2_05 as the program wants, I know the classpath is in the environment variables in my computer but ?do not know to arrange jar files. This program wants 1.4.2_05 only and my computer has only 1.4 so how can I arrange classpath and jar values. thanks for your help.

carikana at 2007-7-14 22:43:41 > top of Java-index,Java Essentials,New To Java...
# 4

> I installed 1.4.2_05 but when I run java

> -version in the prompt it says Java(TM) 2 Runtime

> Environment, Standard Edition (build 1.3.1_01). there

> is a conflict, can anyone hep me to solve the problem?

This isn't a classpath issue, it's a path issue. Although you may have installed 1.4, your path is still set up to reference a 1.3 installation. You didn't say what OS you're running. If it's Windows, changing the path is simple. If it's Linux, you have a couple of choices: put your 1.4 bin directory first in the path, or (if you have root access) change /etc/alternatives/java (and javac) to point to the correct programs.

To the poster who suggested checking classpaths: the missing class is in the "java" package, which means that it's in the JRE/JDK distribution (rt.jar). This is referenced in the "boot classpath," which the JVM figures out based on its own invocation path. The particular class was added to the JRE with version 1.4, which is why it doesn't show up when running a 1.3 JVM.

kdgregorya at 2007-7-14 22:43:41 > top of Java-index,Java Essentials,New To Java...