Note that classes found through the classpath are subject to automatic recompilation if their sources are found.
If packages are used, the local path name within the directory or archive must reflect the package name. As with the user class path, source path entries are separated by semicolons ( ) and can be directories, JAR archives, or ZIP archives.
Specify the source code path to search for class or interface definitions. The compiler defaults to the 1.3 behavior if the -source flag is not used. When release is set to 1.3, the compiler does not support assertions. When release is set to 1.4, the compiler accepts code containing assertions.
Valid keywords are:Įnables support for compiling source code containing assertions. Generate only some kinds of debugging information, specified by a comma separated list of keywords. By default, only line number and source file information is generated.ĭo not generate any debugging information. Generate all debugging information, including local variables. If -encoding is not specified, the platform default converter is used. Set the source file encoding name, such as EUCJIS/SJIS. Without -deprecation, javac shows the names of source files that use or override deprecated members or classes. Show a description of each use or override of a deprecated member or class. Note that the directory specified by -d is not automatically added to your user class path. If -d is not specified, javac puts the class file in the same directory as the source file. For example, if you specify -d c:\myclasses and the class is called 圜lass, then the class file is called c:\myclasses\com\mypackage\M圜lass.class. If a class is part of a package, javac puts the class file in a subdirectory reflecting the package name, creating directories as needed. The destination directory must already exist javac will not create the destination directory. Set the destination directory for class files. If the -sourcepath option is not specified, the user class path is searched for source files as well as class files. See Setting the Class Path for more details. If neither CLASSPATH or -classpath is specified, the user class path consists of the current directory. Set the user class path, overriding the user class path in the CLASSPATH environment variable. The -J options are not allowed in these files.
This is what happens when you package Java programs using this line of code. Javac -d and then underneath that is the as400samplecode directory and then the java class.
Once inside the QSH, next to the $ sign typeįor example cd /myName/Java, when your get the $ sign back that means execution is complete. To start the Qshell use command QSH and press ENTER. To compile the Java program we are going to use the command javac in Qshell
Now you can create a new file called SimpleJava.java in the IFS directory of your choice or use Eclipse to create the program and then FTP it to iSeries. Here is a sample Java program that we will try to compile package com.as400samplecode
To compile java program in iSeries you need to have JDK installed.Ĭlick here to learn how to check if Java is installed on your iSeries and what is the the Java Version?