• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Legible PATH and CLASSPATH

    January 24, 2007 Ted Holt

    Dear Professional:

    One of the things I don’t like about the Integrated File System (IFS) is its directory-based structure of untyped files. I consider the library system of strongly typed objects a much more robust architecture. Nevertheless, the IFS is reality and I have to deal with it. Here’s a short and simple tip for reading those ugly, almost indecipherable PATH and CLASSPATH variables we have to put up with.

    The PATH and CLASSPATH variables contain lists of directories, separated with colon characters. They function like library lists, in that the system searches the lists when looking for certain things. The PATH variable lists the directories that are to be searched when looking for files. The CLASSPATH variable lists the directories that are to be searched for Java classes. The longer these variables get, the uglier they get. Here’s an example of a relatively benign CLASSPATH.

    .:/Aps:/java/msbase.jar:/java/msutil.jar:
    /java/mssqlserver.jar:/qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar

    A simple Qshell command gives CLASSPATH an air of civilization.

    echo $CLASSPATH | tr ":" "n"
    

    Here’s the result:

    .                                             
    /Aps                                          
    /java/msbase.jar                              
    /java/msutil.jar                              
    /java/mssqlserver.jar                         
    /qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar
    

    So how does it work? The echo command writes the CLASSPATH value to standard output. The pipe (vertical bar) picks up echo’s output and passes it along to the tr (translate) utility, which converts colons to line-feed characters. The output goes to standard output, which in this case is a green-screen Qshell session.

    Want to make it even clearer? Number the lines!

    echo $CLASSPATH | tr ":" "n" | cat -n
    

    Here’s the numbered list:

    1  .                                             
    2  /Aps                                          
    3  /java/msbase.jar                              
    4  /java/msutil.jar                              
    5  /java/mssqlserver.jar                         
    6  /qibm/ProdData/HTTP/Public/jt400/lib/jt400.jar
    

    The second pipe feeds the output of tr to the cat utility, which displays the lines. The n switch tells cat to number the lines as it displays them.

    –Ted



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    VISUAL LANSA 16 WEBINAR

    Trying to balance stability and agility in your IBM i environment?

    Join this webinar and explore Visual LANSA 16 – our enhanced professional low-code platform designed to help organizations running on IBM i evolve seamlessly for what’s next.

    🎙️VISUAL LANSA 16 WEBINAR

    Break Monolithic IBM i Applications and Unlock New Value

    Explore modernization without rewriting. Decouple monolithic applications and extend their value through integration with modern services, web frameworks, and cloud technologies.

    🗓️ July 10, 2025

    ⏰ 9 AM – 10 AM CDT (4 PM to 5 PM CEST)

    See the webinar schedule in your time zone

    Register to join the webinar now

    What to Expect

    • Get to know Visual LANSA 16, its core features, latest enhancements, and use cases
    • Understand how you can transition to a MACH-aligned architecture to enable faster innovation
    • Discover native REST APIs, WebView2 support, cloud-ready Azure licensing, and more to help transform and scale your IBM i applications

    Read more about V16 here.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Computer Keyes:  Rapidly convert *SCS printer files into black and white or full color PDF documents
    Databorough:  X-analysis is the world leader in AS/400 application retro-documentation
    COMMON:  Join us at the 2007 conference, April 29 – May 3, in Anaheim, California

    Aras Delivers Open Source PLM Software The Vanishing IT Woman–System i Women Respond

    Leave a Reply Cancel reply

Volume 7, Number 3 -- January 24, 2007
THIS ISSUE SPONSORED BY:

SEQUEL
WorksRight Software
VAULT400

Table of Contents

  • Using the SQL SET OPTION Statement
  • Legible PATH and CLASSPATH
  • Admin Alert: Updating Your System i5 for Daylight Saving Time Changes

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle