aspose file tools*
The moose likes Java in General and the fly likes Compiler Error Version Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compiler Error Version Problem" Watch "Compiler Error Version Problem" New topic
Author

Compiler Error Version Problem

Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
I have installed jdk 1.5 and jdk 1.3 in my pc..

I want to compile code using 1.3 How can i do it

I have set
classpth = jdk1.3/lib
path =jdk1.3/bin
java_home = jdk1.3

But it is take jdk1.5 in java -version

i dont want to use javac -source 1.3 *.java

because i think this is compile by 1.5 according to java 1.3 so my another(java 1.3) server given error (MajorMinor Version 59.0 ) so how can i compile java file using jdk1.3 without remove jdk1.5...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

But it is take jdk1.5 in java -version

So your PATH is no set properly.


[My Blog]
All roads lead to JavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14113
    
  16

If you type in "set PATH" in a command prompt, it will show you what the PATH is set to. Is JDK 1.5 still in the path, before JDK 1.3?

Windows looks at the path from left to right, so if JDK 1.5\bin is in the PATH before JDK 1.3\bin, it will use JDK 1.5.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
My path setting is C:\jdk1.3.1_17\bin
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
Here is the List of all My set variables:

C:\jdk1.3.1_17>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\User\Application Data
CATELINA_HOME=C:\Program Files\java\Tomcat 5.0
CLASSPATH=C:\jdk1.3.1_17\lib;C:\Program Files\jdk1.5.0_06\lib;C:\Program Files\j
ava\Sun\AppServer\lib\j2ee.jar;.;
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=KISPL-WEBRAJ-03
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\User
J2EE_HOME=C:\Program Files\java\Sun\AppServer
JAVA_HOME=C:\jdk1.3.1_17
LOGONSERVER=\\KISPL-WEBRAJ-03
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Program Files\Corel\Corel SVG Viewer\;C:\WINDOWS\system32;C:\WINDOWS;C:\
WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Pro
gram Files\IDM Computer Solutions\UltraEdit-32;C:\jdk1.3.1_17\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0403
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\User\LOCALS~1\Temp
TMP=C:\DOCUME~1\User\LOCALS~1\Temp
USERDOMAIN=KISPL-WEBRAJ-03
USERNAME=User
USERPROFILE=C:\Documents and Settings\User
windir=C:\WINDOWS
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Where is 1.5 installed ?
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
I have found two copy of jdk1.5

jdk1.5

C:\Program Files\java\jdk1.5.0_06
C:\Program Files\jdk1.5.0_06

jdk1.3

C:\jdk1.3.1_17
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Check in each of the following directory if there is a java.exe in it:
1. C:\Program Files\Corel\Corel SVG Viewer\
2. C:\WINDOWS\system32
3. C:\WINDOWS
4. C:\WINDOWS\System32\Wbem
5. C:\Program Files\Microsoft SQL Server\80\Tools\BINN
6. C:\Program Files\IDM Computer Solutions\UltraEdit-32
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
Hi

I have found java.exe in

C:\WINDOWS\system32

it might be for jre 1.5 which i have installed explicitly because some applet requre 1.5 so i have installed for browser...

i am wonder that if i have uninstalled jre 1.5 then applet not running ..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

It's ok. Correct your PATH variable so that 1.3 comes first.
For example :
Path=C:\jdk1.3.1_17\bin;C:\Program Files\Corel\Corel SVG Viewer\;C:\WINDOWS\system32;C:\WINDOWS;C:\
WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Pro
gram Files\IDM Computer Solutions\UltraEdit-32
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
in path variable some value come automatically so my

Path =C:\jdk1.3.1_17\bin

become

Path=C:\Program Files\Corel\Corel SVG Viewer\;C:\WINDOWS\system32;C:\WINDOWS;C:\
WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Pro
gram Files\IDM Computer Solutions\UltraEdit-32;C:\jdk1.3.1_17\bin

How can i take first C:\jdk1.3.1_17\bin in Path variable..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

in path variable some value come automatically

Well, it does not come magically
Go the System Properties (right click on My Computer).
Select the Advanced tab, and go to "Environment Variables".
Here, you'll see the PATH. Modify it so that 1.3 comes first.
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
Okay not automatically but implicitly..

means I have installed some software so it is come implicitly

Right now only one value in path and it is "jdk1.3" but it is come last..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Compiler Error Version Problem