(Answer) (Category) FAQ-O-Matic : (Category) General : (Category) Compiler :
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.
2001-Feb-26 4:26pm gyles19@visi.com

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'.
2001-Dec-30 10:41am gyles19@visi.com

[Append to This Answer]
2001-Dec-30 10:41am
Previous: (Answer) Error #: 750 : initialization error: com.borland.compiler.symtab.LoadError: neither class nor source found for java.lang.Object
Next: (Answer) My WebLogic project won't compile on JDK 1.3. I get "Error #: 300 : method getAction() not found in class javax.swing.AbstractButton", and others.
This document is: http://www.visi.com/~gyles19/cgi-bin/fom.cgi?file=81
[Search] [Appearance]
This is a Faq-O-Matic 2.709.
This FAQ administered by gyles19@visi.com.

Other JBuilder Links

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
Netring Home - About - Privacy
The
JBuilder Netring Logo
The Borland JBuilder Netring by JBuilder FAQ-O-Matic
[ Join Now | List Sites | Random | << Prev | Next >> ]
[ Previous 5 Sites | Skip Previous | Skip Next | Next 5 Sites ]