problems with Oracle9i and Java runtime environment

Recently I've installed Oracle 9i application server into my machine. I've installed

javase 5 update 3 before. Now the problem arise after I've installed Oracle 9i.

I've set the environment path variable accordingly. Now the source files compiles accordingly with my javase 5 javac command. but problem occurs when I try to run the class file using java command. They give me the following error.

java ConnectToOracle

Exception in thread"main" java.lang.UnsupportedClassVersionError: ConnectToOrac

le (Unsupported major.minor version 49.0)

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)

for your information when I check the version of javac command using the command in the command line javac -version

it tells me javac 1.5.0_03

javac: no source files

Usage: javac <options> <source files>......

but when I use java -version

it tells me java version"1.3.1_01"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)

Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

which is a older version! I've also tried...

jre

Java(tm) Runtime Loader Version 1.1.8.10

Usage: jre [-options] classname [arguments]

Options:........

this is also an older jre

now my path is set as PATH=D:\jdk1.5.0_03\bin;

but still it wont working.

BUT if I give the absolute path like this explicitly like this: D:\jdk1.5.0_03\bin\java ConnectToOracle

the programs runs fine!

I guess my Oracle 9i has its own Jre running.

I've reinstalled jdk but that didnt solve the problem.

now please tell me how to get rid of this as I want to run the file using java command comes with jdk1.5.03 and have the latest jre!

[2523 byte] By [mr47a] at [2007-10-2 13:43:12]
# 1
Change the PATH variable so the Jdk path is the first in the list of paths.
atmguya at 2007-7-13 11:38:21 > top of Java-index,Developer Tools,Java Compiler...
# 2
that wont solve the problem! because I've only one entry in my environment variable.
mr47a at 2007-7-13 11:38:21 > top of Java-index,Developer Tools,Java Compiler...
# 3

> that wont solve the problem! because I've only one

> entry in my environment variable.

Then you are not setting the system path. At least, on my Win XP and Win 2000 computers, the path contained

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

when the computer was initially configured. Somehow, your system is finding a java.exe file. As far as I know, Windows only looks in the current directory and in the Path directories.

atmguya at 2007-7-13 11:38:21 > top of Java-index,Developer Tools,Java Compiler...
# 4

> Recently I've installed Oracle 9i application server

> into my machine. I've installed

> javase 5 update 3 before. Now the problem arise

> e after I've installed Oracle 9i.

> I've set the environment path variable accordingly.

> Now the source files compiles accordingly with my

> javase 5 javac command. but problem occurs when I try

> to run the class file using java command. They give

> me the following error.

>

> > java ConnectToOracle

> Exception in thread "main"

> java.lang.UnsupportedClassVersionError:

> ConnectToOrac

> le (Unsupported major.minor version 49.0)

> at java.lang.ClassLoader.defineClass0(Native

> 0(Native Method)

> at java.lang.ClassLoader.defineClass(Unknown

> (Unknown Source)

> at

> at

> at

> at

> java.security.SecureClassLoader.defineClass(Unknown

> Source)

> at

> at java.net.URLClassLoader.defineClass(Unknown

> known Source)

> at java.net.URLClassLoader.access$100(Unknown

> (Unknown Source)

> at java.net.URLClassLoader$1.run(Unknown

> (Unknown Source)

> at

> at

> at

> at java.security.AccessController.doPrivileged(Native

> Method)

> at java.net.URLClassLoader.findClass(Unknown

> (Unknown Source)

> at java.lang.ClassLoader.loadClass(Unknown

> (Unknown Source)

> at

> at

> at

> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown

> Source)

> at java.lang.ClassLoader.loadClass(Unknown

> (Unknown Source)

> at

> at

> at java.lang.ClassLoader.loadClassInternal(Unknown

> wn Source)

>

>

> for your information when I check the version of

> javac command using the command in the command line

> javac -version

> it tells me javac 1.5.0_03

> javac: no source files

> Usage: javac <options> <source files>......

> but when I use java -version

> it tells me java version "1.3.1_01"

> Java(TM) 2 Runtime Environment, Standard Edition

> (build 1.3.1_01)

> Java HotSpot(TM) Client VM (build 1.3.1_01, mixed

> mode)

> which is a older version! I've also tried...

> jre

> Java(tm) Runtime Loader Version 1.1.8.10

> Usage: jre [-options] classname [arguments]

> Options:........

>

this is also an older jre

>

> now my path is set as

> PATH=D:\jdk1.5.0_03\bin;

>

> but still it wont working.

>

> BUT if I give the absolute path like this explicitly

> like this: D:\jdk1.5.0_03\bin\java

> ConnectToOracle

the programs runs fine!

>

> I guess my Oracle 9i has its own Jre running.

>

> I've reinstalled jdk but that didnt solve the

> problem.

> now please tell me how to get rid of this as I want

> to run the file using java command comes with

> jdk1.5.03 and have the latest jre!

shanthi_balagama at 2007-7-13 11:38:21 > top of Java-index,Developer Tools,Java Compiler...
# 5

I faced the same problem. But you can try the followings:

create a .bat file in your source directory and add following lines(1 and 3 or 2 and 3)

1. "javac -source 1.3 source_code_name.java" for Oracle 9i or

2. "javac -source 1.4 source_code_name.java" for Oracle 10g and

3. "java source_code_name"

hope that will work because this way works for me.

red_suna at 2007-7-13 11:38:21 > top of Java-index,Developer Tools,Java Compiler...