This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Resources sorting in CLASSPATH are not same in different Linux kernels  RSS feed

Leon Pu
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
Server 2: CLASSPATH=../../a/Pbc.jar:../../a/

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

Best regards,
Jesper de Jong
Java Cowboy
Posts: 16028
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!