ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Not able to compile JAVA code in AS/400 through QSH.

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

  • Not able to compile JAVA code in AS/400 through QSH.

    Hi All,

    I have written below mentioned JAVA program in IFS directory. But When I am going to compile the program it is giving error. Could you please help me to solve the issue.
    JAVATEST Code:
    class JAVATEST {
    public static void main(String[] args) {
    System.out.println("Hello World!"); // Display the string.
    }
    }

    Error:
    javac: invalid flag: JAVATEST.JAVA

  • #2
    Re: Not able to compile JAVA code in AS/400 through QSH.

    Rename your JAVATEST.JAVA File to --> JAVATEST.java

    Comment


    • #3
      Re: Not able to compile JAVA code in AS/400 through QSH.

      Thanks dhanuxp. It worked. I have another problem, I written below mentioned code (see attachment) in AS400 and it compiled properly. But, while running from qsh in AS400 it gives some headless exception. Could you help me to resolve this problem.
      Attached Files

      Comment


      • #4
        Re: Not able to compile JAVA code in AS/400 through QSH.

        You can't run a swing gui on a platform like the AS400. The AS400 has a green screen UI so there is nowhere for it to render the windows. The only time you can use the AWT classes on the AS400 is if you're writing graphics to a file or somewhere like the IFS, in other words any output other than the main display.
        Ben

        Comment

        Working...
        X