ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Wrong class name ???

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

  • Wrong class name ???

    Hi Guys,

    I really dont get JAVA sometimes, any idea what the compiler is doing here?

    I'm just playing around with some really basic example code.

    HelloWord is long gone so I dont see where it's getting it from (nothing in the source file I checked).

    Thanks,
    Andy.




    PHP Code:
     ls -l                                                                              
       total
    16 kilobytes                                                                
       
    -rwxrwxrwx  1 IMAGEWRITE  0                   128 Aug  4 16:28 BasicJDBC.java      
       
    $                                                                                  
     > echo 
    $CLASSPATH                                                                                       
       
    .:/QIBM/ProdData/Java400/jdk13/lib/tools.jar                                                          
       
    $                                                                                                     
     > 
    javac -verbose BasicJDBC.java                                                                         
       
    [parsing started BasicJDBC.java]                                                                      
       [
    parsing completed 234ms]                                                                             
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/lang/Object.class)]                         
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/lang/String.class)]                         
       [
    checking HelloWorld]                                                                                 
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/lang/System.class)]                         
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/io/PrintStream.class)]                      
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/io/FilterOutputStream.class)]               
       [
    loading /QIBM/ProdData/OS400/Java400/jdk/lib/rt.jar(java/io/OutputStream.class)]                     
       [
    wrote HelloWorld.class]                                                                              
       [
    total 411ms]                                                                                         
       $ 

  • #2
    Re: Wrong class name ???

    Since I've never yet met a compiler that made things up - and you obviously once had a HelloWorld class - I have to believe that you are looking at the wrong source if you think that there is no HelloWorld definition in the file.

    If you still can't find it I would suggest deleting the JDBC file and trying again.

    Comment


    • #3
      Re: Wrong class name ???

      I tried this again this moring after double checking everything and it worked (I didnt change anything promise!)

      I suspect this had something to do with using CRTJVAPGM on the original HelloWorld.class after compiling it and maybe then renaming the HelloWorld.java file to BasicJDBC.java.

      Google documentation leads me to suspect I shouldn't even be using CRTJVAPGM (i'm on v5r4) does anyone know ?

      I can see that CRTJVAPGM does things with objects in qtemp so maybe some uneducated series of commands being issue messed it up and signing off overnight just cleared down qtemp?

      Comment


      • #4
        Re: Wrong class name ???

        Save yourself the headache of command line java compiling and get yourself a decent IDE.

        If you have Websphere where you work, you're set. Just ask someone there to set it up appropriately for both Java and RPG.

        Otherwise, I'd recommend using Eclipse (it's free) www.eclipse.org

        Websphere is based off of Eclipse, so if your company ever decides to start using it, you'll have a natural adaptation to the system.

        Hope that helps some.

        Comment


        • #5
          Re: Wrong class name ???

          Thanks. I'm actually trying to get WDSC up and running but having some issues, I'll make a separate post.

          Comment

          Working...
          X