I'm working with IBM i (often called an AS/400 server).
Currently I have been able to create .CLASS
files and run perfectly
in as400 Directory (I think it's called IFS or something like) a have my tree like:
/
+--Javacfd/
+--bin/
+--com/
+---company/
Class1.class
Class2.class
Hello.class
Server.class
+---other/
Other.class
Another.class
Etc.class
When I run RUNJVA CLASS('com.company.Hello')
Works well! Or
RUNJVA CLASS('com.company.other.Other')
Now I need run a executable jar
In windows java -jar my-jar.jar
Works well
I as400 I tried
RUNJVA CLASS('hello.Application') CLASSPATH(':\Javacfd\bin\my-jar.jar')
I get
Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application
RUNJVA CLASS('hello.Application') CLASSPATH('Javacfd\bin\my-jar.jar')
I get
Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application
RUNJVA CLASS('hello.Application') CLASSPATH('\Javacfd\bin\my-jar.jar')
I get
Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application
RUNJVA CLASS('hello.Application')
I get
Exception in thread "main" java.lang.NoClassDefFoundError: hello.Application
Note hello
is package and Application
is a Main class. Jar file is locale in \Javacfd\bin\my-jar.jar
I'm doing wrong?
Assuming the jar contains a proper manifest you specify the jar file on the RUNJVA command CLASS parameter:
RUNJVA CLASS('/Javacfd/bin/my-jar.jar')
You can also use the standard java tools and utilities through the Qshell interpreter:
QSH CMD('java -jar /Javacfd/bin/my-jar.jar')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With