× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Why CLASSPATH behave so strange?
  • From: Blair Wyman <wyman@xxxxxxxxxxxx>
  • Date: Thu, 25 Mar 1999 09:45:06 -0600 (CST)

Excerpts from java400-l: 24-Mar-99 Why CLASSPATH behave so str..
Ioachim@aol.com (970*) 

>  I do CD /TEMP and get the answer that the current directory really
> changed. STRSQH and java Hello.  

The order of the steps here is the problem... 

The current working directory (/TEMP in this case) does not carry into
the QShell session when you STRQSH (though environment variables like
CLASSPATH do). 

The solution is to cd from within the QShell session ('>' represents the
Command Entry prompt, '$' the qsh prompt): 
        > STRQSH 
        $ cd /temp 
        $ java Hello 

FWIW, IBM ships a simple Hello example in com.ibm.as400.system.Hello --
to try it you can either: 
        > STRQSH 
        $ java com.ibm.as400.system.Hello 
or 
        > JAVA CLSF('com.ibm.as400.system.Hello') 
or even 
        > STRQSH  CMD('java com.ibm.as400.system.Hello') 


> Another question is why when I close the AS400 session and open it again, I 
>do 
> not find this CLASSPATH variable !? 

CLASSPATH, like all environment variables, is scoped only to the current
process and its child processes -- that's the POSIX way.  So, as long as
you set CLASSPATH (or any other environment variable) at the Command
Entry screen with ADDENVVAR or WRKENVVAR, any QShell session started
from *that particular* Command Entry will contain those variables. 

To ensure that you have some environment variable set *every* time you
STRQSH, regardless of the environment coming from Command Entry, you
need to modify some special files.  A complete discussion is beyond the
scope of your question, but basically you add QSH-syntax commands to
either the global startup profile (/etc/profile) or your personal QShell
profile ($HOME/.profile), or both. 

Anyway, I don't want to core dump too badly...  I personally think this
list would be an appropriate forum for QShell (POSIX shell) questions on
the AS/400, but perhaps our moderator has other suggestions or opinions. 

Finally, a more complete discussion of the QShell can be found at: 
http://publib.boulder.ibm.com/pubs/html/as400/ic2924/info/java/rzahz/qshell.htm


HTH and have fun with Java. 

  ___   _           Blair Wyman                  IBM Rochester 
 ( /_)  /  _  ' _   (507)253-2891            blairw@us.ibm.com 
__/__)_/_<_/_/_/_'  Opinions expressed may not be those of IBM 

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.