Author |
Message
|
Agent MQ |
Posted: Thu May 01, 2003 10:28 am Post subject: compile/run Java programs on AIX |
|
|
 Novice
Joined: 04 Apr 2003 Posts: 19
|
Maybe this is the question I should havew asked originally..
I use java on windows platform great but now I want to learn how to write some MQ programs in java on the AIX.
the AIX OS is 5.1 and MQ is 5.2
i looked and I see /usr/java130/bin/ and I see javac etc so it appears I would be able to write some simple java programs -
my question is:
1-how would i go about writing a simple "hello world" pgm, compile it and run it on the aix.
2-write a simple MQput pgm in java
3- write a pcf pgm in java(i think i may need to install the msob support pac for this one)
thanks in advance |
|
Back to top |
|
 |
bower5932 |
Posted: Thu May 01, 2003 10:55 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I'd suggest grabbing a java program from the Software Repository on this site or from http://www.developer.ibm.com/tech/sampmq.html. You ought to be able to then "javac progname.java" to compile it. You'll then be able to "java progname" to run it. You'll need to make sure that your classpath is set correctly. There are details in the Using Java manual, and you can also do searches on this site. |
|
Back to top |
|
 |
Agent MQ |
Posted: Thu May 01, 2003 11:20 am Post subject: |
|
|
 Novice
Joined: 04 Apr 2003 Posts: 19
|
sweet, thanks bower. I will go try it out. |
|
Back to top |
|
 |
ucbus1 |
Posted: Thu May 01, 2003 11:28 am Post subject: |
|
|
Knight
Joined: 30 Jan 2002 Posts: 560
|
Agent MQ,
here is a sample script for setting the needed java environment, some of the jars I mentioned may not be applicable to you. let me know if it helps
!/bin/sh
JREHOME=/usr/java130
export JREHOME
export PATH=/usr/java130/bin:/usr/java130/jre/bin:$PATH
export LIBPATH=$LIBPATH:/usr/mqm/java/lib
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib/com.ibm.mq.jar
export CLASSPATH=$CLASSPATH:/usr/lpp/fmc/bin/java3322/fmcojagt.jar
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib/connector.jar
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib/jconn2.jar
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib/jta.jar
export CLASSPATH=$CLASSPATH:/usr/mqm/java/lib/xerces.jar
export CLASSPATH=$CLASSPATH:/workflow/dvlp/lib/syslib.jar
export CLASSPATH=$CLASSPATH:/workflow/dvlp/lib/MQ.jar
export CLASSPATH=$CLASSPATH:/workflow/dvlp/lib/"*****your Java files ".jar
$JREHOME/bin/java "your program".java
Hope this helps |
|
Back to top |
|
 |
Agent MQ |
Posted: Thu May 01, 2003 12:08 pm Post subject: |
|
|
 Novice
Joined: 04 Apr 2003 Posts: 19
|
I do not see a directory for /usr/mqm/java/lib...
only /usr/java130 |
|
Back to top |
|
 |
bower5932 |
Posted: Thu May 01, 2003 12:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|