Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java 1.5



Originally posted 9 months ago on February 5, 2004:

You can experiment with J2SE 1.5's generics, enums, autoboxing, new loop structure and static Math import on Mac OS X by installing Sun's early access package.

Some tips on Mac OS X installation
----------------------------------

1. Download the zip file from Sun:

http://java.sun.com/developer/earlyAccess/adding_generics/

2. Edit the bootstrap, javac and java shell scripts in the scripts directory to set these variables:

export J2SE14="/Library/Java/Home"
export JSR14DISTR="/Users/me/adding_generics-2_4ea"

where the value of the environmental variable JSR14DISTR depends on where you've downloaded the early access directory.

3. Delete the "/jre" portion of the pathnames in the javac and java shell scripts. For example:

${J2SE14}/jre/lib/rt.jar

becomes

${J2SE14}/lib/rt.jar

etc.

4. Run the bootstrap script from the top level of the JSR14 installation:

cd /Users/me/adding_generics-2_4ea
sh scripts/bootstrap

5. Copy the gjc-rt.jar, collect.jar and newrt.jar files into the /Library/Java/Extensions/ directory:

sudo cp gjc-rt.jar /Library/Java/Extensions/
sudo cp collect.jar /Library/Java/Extensions/
sudo cp newrt.jar /Library/Java/Extensions/

6. Make a copy of, then hack, the "javac" and "java" shell scripts that Sun provides to make them look something like the following. (I renamed mine "tigerc" and "tiger".)

File tigerc:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#!/bin/sh

export JAVA_HOME="/Library/Java/Home"
export JAVA_EXT="/Library/Java/Extensions"

if [ ! "$*" ]; then
	# if no arguments, print usage
	exec ${JAVA_HOME}/bin/javac -J-Xbootclasspath/p:${JAVA_EXT}/gjc-rt.jar
fi

exec ${JAVA_HOME}/bin/javac -J-Xbootclasspath/p:${JAVA_EXT}/gjc-rt.jar -bootclasspath ${JAVA_EXT}/gjc-rt.jar:${JAVA_EXT}/collect.jar:${JAVA_HOME}/lib/rt.jar -source 1.5 -target jsr14 "$@"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


File tiger:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#!/bin/sh

export JAVA_HOME="/Library/Java/Home"
export JAVA_EXT="/Library/Java/Extensions"

exec ${JAVA_HOME}/bin/java -Xbootclasspath/p:${JAVA_EXT}/gjc-rt.jar "$@"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

7. Make these shell scripts executable with:

chmod +x tigerc
chmod +x tiger

then copy them into a directory pointed to by your shell's path variable, something like /usr/bin or /usr/local/bin:

sudo cp tigerc /usr/bin/
sudo cp tiger /usr/bin/

8. Compile and run your Java 1.5 programs:

tigerc Test.java
tiger Test

Have fun!
Craig

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.