[MAGNOLIA-341] Magnolia SVN doesn't compile under Mac OS X without a little modification Created: 22/Apr/05  Updated: 26/Jul/05  Resolved: 26/Jul/05

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 2.1 Final
Fix Version/s: 2.1 Final

Type: Improvement Priority: Minor
Reporter: Ludovic Maître Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X only


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

As documented in the last url of this post, the Magnolia build file should not include a dependency versus tools.jar under Mac OS X.

Actually, one must comment this dependency for Magnolia 2.1 to build without error under Mac OS X.

This is very specific to the platform, so the simple fact that this is documented here should be enough to resolve the bug, and perhaps this is not easy to do under maven (AFAIK we cannot add dependency in a platform specific way under maven [and i understand that since Java is multiplatform by essence]).
See
http://developer.apple.com/documentation/Java/Conceptual/Java14Development/Development_Tools/chapter_3_section_1.htm
for more informations.



 Comments   
Comment by Ludovic Maître [ 22/Apr/05 ]

Sorry wrong url, missing "l" at the end:
http://developer.apple.com/documentation/Java/Conceptual/Java14Development/Development_Tools/chapter_3_section_1.html

Comment by Fabrizio Giustina [ 22/Apr/05 ]

Hi Ludovic, which is the jar in MacOsX containing the javac classes?
tools jar is only needed for unit tests (which actually are really poor), so you can:

  • comment the dependency
  • make tools jar point to the correct macOsX jar containing javac by adding the correct entry in project.properties or build.properties.

I don't have a way to test a build with OSX, if you can look for the javac jar I can give you more instructions...

Comment by Stuart Piltch [ 22/Apr/05 ]

The classes that are usually found in tools.jar on other platforms are found by javac on MacOS X without having to add a jar file to the classpath explicitly (they're already in the default classpath on jdk 1.4.1 and up). So, commenting out the tools.jar dependency in project.xml works fine (as Ludovic mentioned). I've had no problem with maven builds on MacOS X with that simply modification.

For scripts that rely on a tools.jar and can't easily be rewritten to not have one, a workaround is to use classes.jar instead.

case "`uname`" in
Darwin*) darwin=true ;;
...
esac

TOOLS_JAR="${JAVA_HOME}/lib/tools.jar"
if $darwin; then
TOOLS_JAR="/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Classes/classes.jar"
fi

This is what the maven startup script does:
http://cvs.apache.org/viewcvs.cgi/maven/src/bin/maven?view=markup

Of course the new MacOS X Tiger with JDK 5 is coming out next week, so this may all change.

Comment by Fabrizio Giustina [ 21/Jul/05 ]

fixed by removing the tools.jar dependency at all.
tools jar is required for testing of jsp pages through servletunit: anyway, since there is only a small test which uses this at the moment, I decided to remove it and to look again to a jsp testing framework in future. I will try to integrate httpunit with tomcat 5.5 and the eclipse compile, which can be safely managed in a maven repository.
Anyway, this issue is closed now.

Comment by Boris Kraft [ 26/Jul/05 ]

reassigned to RC3

Generated at Mon Feb 12 03:16:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.