aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "classpath" Watch "classpath" New topic
Author

classpath

Amali Prem
Greenhorn

Joined: Dec 13, 2007
Posts: 17
Hi,

can someone clarify me this? i have set my environment variables as below:

CLASSPATH :C:\Program Files\Java\JDK 1.4
JAVA_HOME :C:\Program Files\Java\JDK 1.4\bin

and now when i give the command ant -verbose, i get something like below :

Detected Java version: 1.5 in: C:\Program Files\Java\jre1.5.0_11

Why does it take 1.5? Can someone explain?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

This is still strange. Where did you get these environment variables from ? And where did you launch ant from ?
[ December 27, 2007: Message edited by: Christophe Verre ]

[My Blog]
All roads lead to JavaRanch
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21



Customer surveys are for companies who didn't pay proper attention to begin with.
Amali Prem
Greenhorn

Joined: Dec 13, 2007
Posts: 17
i am running ant from command line. what property should i set so that the ant compilation happens in 1.4?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Make sure you didn't put a custom ant.bat somewhere in your PATH. By the way, did you edit Ant's ant.bat, in Ant's installation bin directory ? (you don't have to)

JAVA_HOME :C:\Program Files\Java\JDK 1.4\bin

Did you get that on the command line too ? Try "echo %JAVA_HOME%".
Amali Prem
Greenhorn

Joined: Dec 13, 2007
Posts: 17
I didnt modify ant.bat and when i give echo %JAVA_HOME% also i get only this C:\Program Files\Java\JDK 1.4\bin

The ant i am using came in as an add in with Netbeans IDE 5.5. should i check for any other property?
krishnamoorthy kitcha
Ranch Hand

Joined: Feb 04, 2006
Posts: 96
Hello,

Did you install any java webtracks like java java runtime environment like jre1.5 or jre1.6 ?

If it is check and replace the path , because you should set path beginning itself .

check and tell me your feedback
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

The version of Java used to run Ant is not dependent on the CLASSPATH. It's determined by the PATH. Which is why I posted the earlier command example.

Note that you can use a Java 1.5 compiler to compile 1.4 code. Just use the "source" attribute on the javac task (that is: source="1.4")
Amali Prem
Greenhorn

Joined: Dec 13, 2007
Posts: 17
when i give echo %path% i get something as below
C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;C:\Program Files\Informix\ClientSDK\bin;
C:\Program Files\Microsoft SQL Server\80\Tools\BINN;
C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Informix\Client-SDK\bin;
C:\Program Files\Microsoft SQL Server\80\Tools\BINN;
D:\NetBeans5.5\ide7\ant\bin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath