Project Builder & Java Packages Build problem

jcart12

Registered
Hi,
Can anyone help me with the following problem. I'm developing a 100% java command tool using project builder.

Obviously I'm using a package hierarchy, but I can't build. That's actually a lie, I could but each time I restart Project Builder I have to physically reorganise my files.

Basically if I put all my java files a in a directory structure which respects my package hierarchy, project builder complains that it can't find the files in the project root directory.

However if I move all the files to the project root directory it complains it can't file the files in the appropriate package directory. This is very annoying.

I don't want have to duplicate all my .java files, that would make project builder unuseable. The annoying thing is that yesterday I moved all the files to the project root directory and it worked. Today I fired up ProjectBuilder and it is now complaining.

Note: All files are visible and editable from within ProjectBuilder.

THe build target is 100% Java App.

Does anybody know how to solve this? otherwise I will have to move over to JBuilder.

regards
John.
 
you seem to have done something wrong. I don't know what, but try to delete all the files from the project and then just drag and drop the directory that contains the package hierarchy from the finder onto the project. now it should work, otherwise you have done something very odd somewhere else. try creating a new project and doing the same, if it doesn't work then, you have really done something wrong and I suggest reading some documentation.

but for developing java-applications I recommend using Ant (http://jakarta.apache.org/ant). It's nice and configurable.


theo/iconara
 
i'm not sure but u may have to "jar" those "dirs"

technically this should't be the case
 
Hi All,
I have tried dragging the top level com folder into the project and letting it recursively recreate folders and group but I'm still getting the problem "don't know ho to make certain files"

Here is the output from my build


/usr/bin/jam -d1 JAMBASE=/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase JAMFILE=- build ACTION=build _DEFAULT_GCC_VERSION=3.1 BUILD_STYLE=Deployment CPP_HEADERMAP_FILE=/Volumes/Documents/Work/FT_Sicor/Development/FtMapping/build/FtMapping.build/FtMapping.build/FtMapping.hmap SRCROOT=/Volumes/Documents/Work/FT_Sicor/Development/FtMapping OBJROOT=/Volumes/Documents/Work/FT_Sicor/Development/FtMapping/build SYMROOT=/Volumes/Documents/Work/FT_Sicor/Development/FtMapping/build DSTROOT=/tmp/FtMapping.dst
don't know how to make /Volumes/Documents/Work/FT_Sicor/Development/code/FtMapping/FtMapper.java
don't know how to make /Volumes/Documents/jcart/Work/FT_Sicor/Development/code/FtMapping/MappingException.java
don't know how to make /Volumes/Documents/jcart/Work/FT_Sicor/Development/code/FtMapping/DbLookupException.java
don't know how to make /Volumes/Documents/jcart/Work/FT_Sicor/Development/code/FtMapping/Mapper.java
don't know how to make /Volumes/Documents/jcart/Work/FT_Sicor/Development/code/FtMapping/RecordMapper.java
don't know how to make /Volumes/Documents/jcart/Work/FT_Sicor/Development/code/FtMapping/TextLineMapper.java
don't know how to make /Volumes/Documents/Work/FT_Sicor/Development/code/FtMapping/com/ft/mapping/mapper/FtRecord.java
don't know how to make /Volumes/Documents/Work/FT_Sicor/Development/code/FtMapping/com/ft/mapping/mapper/FtElement.java
...updating 10 target(s)...
 
You're trying to build it as a C-program. Create a new project and make sure that you select Java application (under Pure Java) as the type. Then drag the source to project builder and compile.

I still recommend ant (jakarta.apache.org/ant) as the tool of choice for Java development.


theo
 
Nope,
definitely selected java tool. I have got around the problem by creating aliases to all my java files and placing them in the project folder. It's not pretty but it works.

regards
 
Rather than a new thread -- I'll tag on to this one:
I am using a simple text editor (by choice) to write my java code. It is easy to compile, even with distinct classes -- as long as they are all in the same user's directory.

But to set up a user's package, well I must either know precisely where OSX stores the java packages, or where I can modify the CLASSPATH .

Help, please.
 
Yup, it can be quite a pain to know how to set the CLASSPATH when there seems no way to set environment vars, even windows does that although badly.

The easy way to solve this is to put the supplied .jar or .zip in the /Library/Java/Extensions directory. That will work for run-time.

For devel time, try setting CLASSPATH from the unix prompt and launching your editor from the same prompt.

Remember, for run-time you can also set your classpath and main-class in the jar's manifest. Very useful as you only have to click on the jar file from OS X to launch it, no command prompt or nothing.

John
 
Back
Top