|
If you are planning to do Java coding on the iSeries, it's probably worthwhile to know a little about QShell. There are a lot of things you can do to make development easier in QShell, but many of these items don't really affect the environment outside of QShell on the iSeries. QShell is a little like a unix shell, so if you want to set variables that last longer than the context of one command, you have to use the export command. So, if you want to set the class path, you would type: export CLASSPATH=/some/directory:/some/file.jar (filling in the proper paths or JAR files you need). Also, you can put a file into your home directory (in IFS it is /home/<userprofile>, but you may have to create it) called ".profile" which is a script that gets run when you log into QShell. In this file, you can put the export statement, and it will get run every time you start a QShell session. This is only good for QShell, however, so don't rely on it for anything other than development. When running in production, however, we usually just set the classpath on the command line using the CLASSPATH parameter of the JAVA command. Another recommendation, especially if you are coding a project of any size on the iSeries using QShell is Ant. Ant is a scripting language a little bit like Make for unix and other OSs that lets you write small scripts that handle compiling, setting Class Paths, and running java without having to type in the Class Path every time. However, Ant is a bit more advanced. The Develop/Test/Debug cycle is much easier to do on a PC however. You can do most of the work there, and then do you integration testing on the iSeries. I think you even get a license of WSAD for iSeries for free. Wow...that rambled around quite a bit! Sometimes there are just too many options, huh? ---------------------------------------------------------------------- Chris DeLashmutt Senior R&D Analyst LeasePlan USA 1165 Sanctuary Pkwy., Alpharetta, GA 30004 Phone: 678-202-8695 Fax: 678-566-8551 ---------------------------------------------------------------------- "Joe Pluta" <joepluta@plutabrot To: "'Java Programming on and around the iSeries / AS400'" hers.com> <java400-l@xxxxxxxxxxxx> Sent by: cc: java400-l-bounces@m Subject: RE: Frustration!! idrange.com 09/23/2003 03:21 PM Please respond to Java Programming on and around the iSeries / AS400 > From: Steven Molinaro > > Thanks for the reply. I tried what you said. I did a cd /Java and then > "set CLASSPATH=.", followed by java HelloWorld and I still got the same > errors. I apologize if I am missing an obvious step. Ugh. It's been a long time since I tried this on the host. I rarely run from QShell these days, partially because of issues like this. After some playing around, I found that "set CLASSPATH" doesn't work inside of QShell. In fact, the set command with a parameter doesn't do much of anything (without parms it shows the current list of environment variables). So, you have to set the CLASSPATH *before* you start QShell, by using the WRKENVVAR command. Now, I don't know why your initial value is pointing to the jt400/lib folder, but as long as you don't care about that, simply use WRKENVVAR to replace your CLASSPATH with "." (no quotes). Then you should be able to go into QShell, cd /Java, and then run your HelloWorld program. I just did it, and it works fine. (The memory begins to clear a little. This all sound vaguely familiar.) Good luck! Joe _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
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.