Re: source code in multiple .class files
C:\Users\Marko\Desktop\java>dir
Volume in drive C is System
Volume Serial Number is 6CA6-552A
Directory of C:\Users\Marko\Desktop\java
04.01.2013 16:18 <DIR> .
04.01.2013 16:18 <DIR> ..
03.01.2013 15:58 1*817 Board.class
04.01.2013 16:18 <DIR> donut
03.01.2013 15:58 652 Donut.class
02.01.2013 21:11 <DIR> New Folder
2 File(s) 2*469 bytes
4 Dir(s) 5*096*202*240 bytes free
Re: source code in multiple .class files
ok.. lets start from the beginning. I have 2 java files Board.java and Donut.java. what do i do next
Re: source code in multiple .class files
Quote:
Originally Posted by
vastrolorde
ok.. lets start from the beginning. I have 2 java files Board.java and Donut.java. what do i do next
- Delete the obsolete class files in C:\Users\Marko\Desktop\java
- Look at the package statements in those two files. That is the subdirectory they have to be in. So a java file with package foo.bar; needs to be in directory C:\Users\Marko\Desktop\java\foo\bar.
- Compile: javac donut\*.java
- Run the class file that has the main method: java donut.Donut
- Both commands are to be executed from the root of the project, being C:\Users\Marko\Desktop\java
Re: source code in multiple .class files