|
|
warning #908: can not append file ... |
JBuilder (and many other Java tools) expect that the location of a .java source
file will reflect the internal package name. For instance, if your project
source path is:/home/gyles19/jbproject/MyProject/src
And you have a source file in which there exists lines like: package com.visi.gyles19
public class Foobar {
...
}
Then the source file itself must be named Foobar.java
and the proper location for Foobar.java is: /home/gyles19/jbproject/MyProject/src/com/visi/gyles19/FooBar.java
This breaks down as: /home/gyles19/jbproject/MyProject/src/com/visi/gyles19/FooBar.java
..................................... <-- sourcepath
package --> ................
class --> ............
This is especially important when debugging. When the debugger attempts to display a source file, it takes the class file's package, converts it to a platform path (ie com.visi.gyles19 becomes com/visi/gyles19) and then appends the class name (to make it com/visi/gyles19/Foobar.java) Java internally converts the "." characters within your package statement into the file.separator characters specific to your platform, ie "\" on Windows/Dos and "/" on Unix. It then goes through the project source path appending the converted package path to each source path provided until it finds the Foobar.java file. If Foobar.java is in the wrong place, the debugger will never find it. The #908 compiler error is another symptom of a misplaced source file.
Rule: .class and .java files must always be placed in directory locations
which reflect the package statement inside the .java file.
| |
| This information also applies to another compile-time error: Warning: check sourcpath: c:\JBuilder3\myprojects\untitled1\MyClass.java cannot be found on sourcepath by appending \MyPackage\MyClass.java to each sourcepath entry.
In the above case, the MyClass.java file contains a 'package MyPackage;'
statement, but it is incorrectly located in directory 'untitled1'.
| |
| [Append to This Answer] | |
| 2001-Dec-30 10:41am |
| ||||||||
|
Java Community
Java Tools |
Code Central JB OpenTools |
Community Recent Threads |
Borland Chat Chat FAQ |
||||||||||||||
|
Feature Matrices 3.0 | 3.5 | 4.0 5.0 | 6.0 | 7.0 |
Shop for JBuilder |
JBuilder Downloads and reg keys |
Report Piracy | ||||||||||||||
|
Online Manuals 4.0 | 5.0 | 6.0 7.0 |
Borland DevSupport's Bug/RFE Form Quality Central Client |
JB Patches & Updates |
JBuilder FAQs TIs | ||||||||||||||
|
JBuilder Newsgroups |
Tamaracka's News Archive |
Mr. Haki's JBuilder Machine |
JGuru's JBuilder FAQ |
||||||||||||||
|
Sun's Bug Parade |
|||||||||||||||||
|
|||||||||||||||||