Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Java will try to search for a directory structure <code>a\b\c</code> from starting in <code>target</code> and as you notice, it wont work. </p> <p>Move the whole directory into <code>target</code> and you'll be fine, it should look like: </p> <pre><code> C:\Temp\a\target\a\b\c\Hello.class </code></pre> <p>You may compile it with the -d option which tall the compiler where to put the class file.</p> <p>Many project structures are like this.</p> <pre><code>C:\whatever\projectname\src C:\whatever\projectname\classes C:\whatever\projectname\bin C:\whatever\projectname\lib C:\whatever\projectname\doc </code></pre> <p>That way you can always step on your project directory and type:</p> <pre><code>javac -d classes src\*.java </code></pre> <p>Which will compile all the sources in the <code>src</code> directory and will place them in the <code>classes</code> directory.</p> <p>Then execute your program:</p> <pre><code>java -cp classes a.b.c.Hello </code></pre> <p>You may optionally place required jars in <code>lib</code> </p> <p>This works pretty fine for small programs ( &lt; 10 src files and 2 - 3 jar libraries ) If it grows beyond that, you could probably use an IDE or ant </p> <p>The good thing about following this project structure is that some IDES ( as IntellJ idea ) just pick them very easily when you create a new project. You select "Create project from existing sources" and then you can continue from there. </p> <p>I like compiling and editing at the command line a lot!!</p>
    singulars
    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. 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