sponsored links

Collapse

Announcement

Collapse
No announcement yet.

Having prblems with executing java from QSH with use of package keyword

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Having prblems with executing java from QSH with use of package keyword

    Hiya I am not new to AS400 AND am not new to JAVA although not as experienced.
    I am new to JAVA on the iSeries.

    I have written a class that reads a table and outputs the info (its called getdetails).
    It works and I can run it from QSH. Its residing in an IFS directory root/home/test

    BUT

    As soon as I add the following line to the JAVA code it all goes completely to pot.
    package home.test;
    I get the error "java.lang.NoClassDefFoundError: home/test/getdetails" blah blah

    I have triple checked CLASSPATH and am sitting in the directory both times when i invoke it BUT without "package" it works . . .with "Package" it does not work and its driving me crazy.

    Has anyone got any idea why its not working. Have attempting to run the code just with the java class name . . .with it fully qualified ie: java home.test.getdetails . . . .but its just not happening.

    I am hoping its just a very silly thing I am or am not doing. PLEASE HELP arrrghhhh

    mogant

  • #2
    Re: Having prblems with executing java from QSH with use of package keyword

    So if your CLASSPATH includes /java/test and your package name is "home.test" (WTF?) then the .class files would need to be in the /java/test/home/test directory in order for it to work. Remember... the package name is treated as a directory name off of the one listed in the CLASSPATH.

    This is true on Unix and Windows as well as IBM i. (At least, that's been my experience.)

    Comment

    Working...
    X