Mulle kybernetiK - Tech Info:
Using Frameworks with JARs in non-WO Apps
Whereas you can easily include Frameworks with JARs (as created by JavaFrameworkMaker) into your WO-Applications, the same unfortunately does not hold true for plain AppKit Apps. This article shows some ways out of the dungeon of Apple Makefiles.
(c) 2000 Mulle kybernetiK - text by Nat!

This Tech Info is written for MacOSXServer 1.2

As many people have noticed, Frameworks bearing Java Archives can easily be used in WebObjects applications, but fail to be recognized in AppKit applications. The fault lies with Apple here, as the Makefiles for applications (starting with app.make in /System/Developer/Makefiles/pb_makefiles) are not able to generate a CLASSPATH to point to the JAR files in the Frameworks. But the Makefiles for WO-apps can handle this. I know of three solutions to this problem, each with it's own pros and cons.

  1. Start your new AppKit project as a WebObjects application and throw out all the default .java files, remove the Web Resources and copy the Objective-C stub main function stub from another AppKit application project.
  2. Patch the Makefile system to use the WO-rules for building CLASSPATH. Changing the Makefile system is a "fire and forget" procedure. The only problem is the forgetting part. People that want to use your source, must patch the system in the same way. Here is the "patch"
    cd /Local/Developer/Makefiles/pb_makefiles
    cp /System/Developer/Makefiles/pb_makefiles/wo-postamble.make app.make.postamble.


  3. Use an editor to copy the needed rules (see below) into your Makefile.postamble. You might even want to modify the template /System/Developer/Makefiles/pb_makefiles/Makefile.postamble.template to include this code (from wo-postamble.make).

You also could ask your OS vendor for a fix...

#########################################################################################
# genclasspath - defined in commands-$(OS).make in pb_makefiles for MOSX
#########################################################################################

ifndef GENCLASSPATH
ifeq "$(OS)" "MACOS"
GENCLASSPATH = /usr/lib/genclasspath
else
ifeq "$(OS)" "NEXTSTEP"
GENCLASSPATH = /usr/lib/genclasspath
else
# This applies for Windows, Solaris, and HPUX.
GENCLASSPATH = $(NEXT_ROOT)/$(SYSTEM_DEVELOPER_DIR)/Executables/genclasspath
endif
endif
endif

STD_FRAMEWORK_SEARCHPATHS = -F$(NEXT_ROOT)/$(SYSTEM_LIBRARY_DIR)/Frameworks -F$(NEXT_ROOT)/$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks

#
# We only want to set these values at the top level of WOF projects where the
# framework values are available.  (This saves computation time as well.) 
#
ifneq "$(CLASSPATHS_COMPUTED)" "YES"
LINKER_ARGS = $(ALL_LDFLAGS) $(LOADABLES) $(STD_FRAMEWORK_SEARCHPATHS)
export FRAMEWORK_CLASSPATH := $(shell $(GENCLASSPATH) -client NO $(LINKER_ARGS))
export FRAMEWORK_CLASSPATH_CLIENT := $(shell $(GENCLASSPATH) -client YES $(LINKER_ARGS))
export DEFAULT_CLASSPATH := $(shell javaconfig DefaultClasspath)
export CLASSPATHS_COMPUTED = YES
endif

CLASSPATH := $(DEFAULT_CLASSPATH)
ifeq "$(OS)" "WINDOWS"
CLASSPATH_DELIMITER = ;
else
CLASSPATH_DELIMITER = :
endif

ifneq "" "$(FRAMEWORK_CLASSPATH)"
CLASSPATH := $(CLASSPATH)$(CLASSPATH_DELIMITER)$(FRAMEWORK_CLASSPATH)
endif
ifneq "" "$(OTHER_CLASSPATH)"
CLASSPATH := $(CLASSPATH)$(CLASSPATH_DELIMITER)$(OTHER_CLASSPATH)
endif

ifneq "" "$(FRAMEWORK_CLASSPATH_CLIENT)"
CLASSPATH_CLIENT := $(CLASSPATH_CLIENT)$(CLASSPATH_DELIMITER)$(FRAMEWORK_CLASSPATH_CLIENT)
endif
ifneq "" "$(OTHER_CLASSPATH_CLIENT)"
CLASSPATH_CLIENT := $(CLASSPATH_CLIENT)$(CLASSPATH_DELIMITER)$(OTHER_CLASSPATH_CLIENT)
endif