顯示具有 mac 標籤的文章。 顯示所有文章
顯示具有 mac 標籤的文章。 顯示所有文章

2009年9月24日 星期四

eclise problem in snow leopard when running java 1.6

error:
"java.lang.NoClassDefFoundError: apple/laf/CoreUIControl"

solution:
add /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaRuntimeSupport.framework/Versions/A/Resources/Java/JavaRuntimeSupport.jar
to classpath of run configuration

enable root user in mac

open "Directory Utility"
click on Edit, click on "Enable root user"

2009年9月23日 星期三

show directory size

du -h -d 1
-d means directory depth

install mac os from dmg file

need 2 partitions, one for installer, one will be where you install os
1. open disk utility
2. click restore tab
3. drag dmg file in source field
4. drag the partition for installer in destination field
5. click erase destination
6. click restore
7. open system preference --> startup disk --> installer partiton
8. restart to install os

2009年9月20日 星期日

check out project(not created from xcode) from cvs in xcode

1. check out project Test
2. create new project Test
command line utility --> standard tool
this will add Test.xcodeproj in the Test directory
3. add all files in Test directory to Source of Test project
4. set project's SCM repository as CVS path

2009年9月18日 星期五

PackageMaker

create install package for mac app

create java app on mac

use "Jar Bundler"

2009年9月17日 星期四

set working directory

1. for cocoa
[[NSFileManager defaultManager] changeCurrentDirectoryPath:@"/test"];

2. linux api ( also for mac)
chdir("/test");


let java menu bar replace app menu bar

method 1:
-Dcom.apple.macos.useScreenMenuBar="true"

method 2:
System.setProperty("com.apple.macos.useScreenMenuBar","true");

2009年9月16日 星期三

compile jni program on xcode

1. set header search path for app target from build panel:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Headers

2. add JavaVM.framework

java location in mac

/System/Library/Frameworks/JavaVM.framework

2009年9月15日 星期二

compile program with core foundation framework

gcc test.c -framework CoreFoundation -o test.o

show file is 64 bit or 32 bits

ex:
file test.0
--> test.o: Mach-O universal binary with 2 architectures
test.o (for architecture x86_64): Mach-O 64-bit executable x86_64
test.o (for architecture i386): Mach-O executable i386

create x86_64 & i386 binary on mac

gcc -o test.o test.c -arch x86_64 -arch i386

compile JNI program on mac

gcc -o launch.o -I/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers -framework JavaVM launch.c -m64