Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I understand that by "implement" you mean that you want to take this sample code and run it.</p> <p>Each Java file contains a top-level class that's named the same as the file. In this case, the class's name is <code>QuickFileUserCount</code> and the file should be named <code>QuickFileUserCount.java</code>. If the file had a "package" statement at the top, then that would specify the directory that the file is in; since it doesn't, it'll be in whatever your working directory is.</p> <p>Java programs start by calling the <code>main</code> method on some class. Any class can have a <code>main</code> method, and so you specify the class that you want to start running in.</p> <p>One detail that makes this example a little more involved is the <code>import</code> from the Apache Commons. This tells Java that the <code>QuickFileUserCount</code> class uses the <code>Base64</code> class from <a href="http://commons.apache.org/proper/commons-codec/" rel="nofollow" title="Apache Commons Codec">Apache Commons Codec</a>. You'll need the Commons Codec library to compile or run this example.</p> <p>It's usually easiest to use an IDE such as Eclipse to develop Java applications, but for a simple trial of this example:</p> <ul> <li>Download the Commons Codec library from the Apache Web site. Unpack <code>commons-codec-1.8.jar</code> into a temporary directory.</li> <li>Save the example with the filename <code>QuickFileUserCount.java</code>.</li> <li><p>Compile it with the following command (you'll need to have the Java Development Kit installed):</p> <pre><code>javac -classpath commons-codec-1.8.jar QuickFileUserCount.java </code></pre> <p>The "classpath" option tells the Java compiler to look for the Base64 class inside that jar file.</p></li> <li><p>Run it using the following command:</p> <pre><code>java -classpath commons-codec-1.8.jar QuickFileUserCount </code></pre> <p>Note that you don't use the ".java" this time. You should see the usage statement printed out.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload