Yes, the class is public. Could it be that main is static?
This class is normally run from the command line, ala:
c:>javaw.exe -cp <classpath> -DJAVA_HOME=C:\Java
org.spec.jappserver.load.LoadCorp 10");
Then the "main" argv parameter will have "10". The build.xml does the
following:
<target name="_loaddb" depends="load">
<property name="LoadPkg" value="org.spec.jappserver.load"/>
<property name="Domain" value="Ords"/>
<java classname="${LoadPkg}.Load${Domain}" fork="true">
<jvmarg value="-Dspecjappserver.home=${JAS_HOME}"/>
<arg value="${SCALE}"/>
<classpath>
<pathelement path="${JDBC_CLASSPATH}"/>
<pathelement path="${CLASSPATH}"/>
<pathelement location="jars/load.jar"/>
</classpath>
</java>
</target>
However, on my system, the <java> call fails because it can't find java.
On our mainframe, java HAS to be run as a command line, it can't be done
just as a class call. So I changed it to fork="false" so it uses the
JVM
that ant is running under. Now I'm getting the current problem.
Apparently
I need to do something like the following. Remember, I'm new to ant.
:-)
<runExe name="javaw.exe"
<arg value="-cp ${JDBC_CLASSPATH}:${CLASSPATH}:jars/load.jar
-DJAVA_HOME=$(JAVA_HOME) ${LoadPkg}.Load${Domain} ${SCALE}">
</runExe>
Is there an ant action such as the one I invented above - runExe?
For the line <property name="Domain" value="Ords"/>, should I just do
-DDomain=Ords?
As an aside, does XML have a way to split wide quoted strings onto two
or more lines? Maybe something like
<arg value="-cp ${JDBC_CLASSPATH}:${CLASSPATH}:jars/load.jar " +
"-DJAVA_HOME=$(JAVA_HOME) " +
"${LoadPkg}.Load${Domain} ${SCALE}">
TIA,
Don Payette
>THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
PROPRIETARY MATERIAL and is thus for use only by the intended recipient.
If you received this in error, please contact the sender and delete the
e-mail and its attachments from all computers.
-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 1:02 AM
To: [email protected]
Subject: Re: NoClassDefFoundError
On Wed, 9 Mar 2005, Don J. Payette <[EMAIL PROTECTED]> wrote:
> This is an interesting one (at least to me). Ant is attempting to
> call LoadCorp (as can be seen from my stdout). It gets an
> IllegalAccessException. Inside LoadCorp is a "main" that looks like
> this:
>
> public static void main(String [] argv) throws Exception {
>
> What is ant's problem?
Is the class itself public?
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]