GeeCON Prague 2014*
The moose likes Java in General and the fly likes Resources sorting in CLASSPATH are not same in different Linux kernels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Resources sorting in CLASSPATH are not same in different Linux kernels" Watch "Resources sorting in CLASSPATH are not same in different Linux kernels" New topic
Author

Resources sorting in CLASSPATH are not same in different Linux kernels

Leon Pu
Greenhorn

Joined: Nov 02, 2005
Posts: 22
Hi all,

I have two environment base on following Linux operating systems, and the JDK version are same as j2sdk1.4.2_12, and locale are also same as en_US.UTF-8.

Linux server1 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686 i686 i386 GNU/Linux
Linux server2 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:28:02 EDT 2006 i686 i686 i386 GNU/Linux

My problem is the resources sorting in CLASSPATH are different in preceding two operating systems. Here is the sample.

Server 1: CLASSPATH=../../a/PbcSrc.zip:../../a/Pbc.jar
Server 2: CLASSPATH=../../a/Pbc.jar:../../a/PbcSrc.zip

Since the only difference of two environment is the kernel version, does it influence the sorting of resources in CLASSPATH?


Best regards,
Leon
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14192
    
  20

The CLASSPATH is an environment variable that you set yourself somewhere, in a configuration file or startup or login script. The system does not automatically set it for you. The Linux kernel does not have anything to do with your CLASSPATH.

You must have slightly different configuration / startup / login scripts on the two systems somewhere.

By the way, it's not a good idea to write Java programs that rely on the fact that things in the CLASSPATH are in a certain order - it makes your program very susceptible to small system configuration changes.
[ November 08, 2006: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resources sorting in CLASSPATH are not same in different Linux kernels