I recenlty bought Bruce Eckels book/pdf "Thinking in Java Fourth Edition" and The Annotated Solutions Guide code examples.
The installation instructions for the code examples are not written for OS X and that is where the trouble starts..
First the CLASSPATH has to be set to the code examples directory.
I can add the CLASSPATH to the bashrc but decided to add the paths to the DefaultClassPath in /System/Library/Java/JavaConfig.plist
Then some jar files have to be copied to a created directory,
javassist.jar, swt.jar, tools.jar, javaws.jar, xom.jar, and added to the CLASSPATH.
So after this the DefaultClassPath looks like this:
Installing ant was easy, so building the code could start using ant...
But it fails
I installed the javassist jar file in the same directory as defined in DefaultClassPath so have no clue what is wrong. Hints / tips ??
Also tools.jar is not available in the JDK installed with OS X wherefore i have not found a workaround. Does somebody have a workaround for this ? Or better complete instructions for installing the code examples from Bruce Eckels Annotated Solution Guide for Thinking in Java. I cannot imagine that i am the first to install this on OS X, and googled ont his subject but have not been able to find any instructions.
Any help is welcome !
The installation instructions for the code examples are not written for OS X and that is where the trouble starts..
First the CLASSPATH has to be set to the code examples directory.
I can add the CLASSPATH to the bashrc but decided to add the paths to the DefaultClassPath in /System/Library/Java/JavaConfig.plist
Then some jar files have to be copied to a created directory,
javassist.jar, swt.jar, tools.jar, javaws.jar, xom.jar, and added to the CLASSPATH.
So after this the DefaultClassPath looks like this:
Code:
DefaultClasspath = "$HOME/Library/Java:$NEXT_ROOT/Library/Java:$NEXT_ROOT/System/Library/Java:$NEXT_ROOT/Network/Library/Java:$NEXT_ROOT/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:$NEXT_ROOT/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/Users/peter/Documents/Java\ training/TIJ4-Solutions-code:/Users/peter/Documents/Java\ training/jars/javassist.jar:/Users/peter/Documents/Java\ training/jars/javaws.jar:/Users/peter/Documents/Java\ training/jars/swt.jar:/Users/peter/Documents/Java\ training/jars/xom-1.1.jar";
Installing ant was easy, so building the code could start using ant...
But it fails
Code:
BUILD FAILED
/Users/peter/Documents/Java training/TIJ4-Solutions-code/build.xml:70: The following error occurred while executing this line:
/Users/peter/Documents/Java training/TIJ4-Solutions-code/net/build.xml:68: You must install the Javassist library from http://sourceforge.net/projects/jboss/
I installed the javassist jar file in the same directory as defined in DefaultClassPath so have no clue what is wrong. Hints / tips ??
Also tools.jar is not available in the JDK installed with OS X wherefore i have not found a workaround. Does somebody have a workaround for this ? Or better complete instructions for installing the code examples from Bruce Eckels Annotated Solution Guide for Thinking in Java. I cannot imagine that i am the first to install this on OS X, and googled ont his subject but have not been able to find any instructions.
Any help is welcome !