--- Main.java.orig	2015-08-06 09:26:48.133065705 +0900
+++ Main.java	2015-08-19 09:08:41.387651238 +0900
@@ -39,15 +39,19 @@
 //			+ SourceFile + ".d";
 
 	// コンパイラコマンドの設定
-	private static final String Compiler = "hardware" + File.separator
-			+ "tools" + File.separator + "avr" + File.separator + "bin"
-			+ File.separator + "avr-g++";
+    //	private static final String Compiler = "hardware" + File.separator
+    //			+ "tools" + File.separator + "avr" + File.separator + "bin"
+    //			+ File.separator + "avr-g++";
+        private static final String Compiler = "avr-g++";
 	private static final String CompilerOption = "-c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101";
 	static final String[] IncludeFiles = {
 			"hardware" + File.separator + "arduino" + File.separator + "cores"
 					+ File.separator + "arduino",
 			"hardware" + File.separator + "arduino" + File.separator
 					+ "variants" + File.separator + "standard",
+			"hardware" + File.separator + "tools" +
+			File.separator + "avr" + File.separator + "lib" +
+			File.separator + "avr" + File.separator + "include",
 			"libraries" + File.separator + "Servo",
 			"libraries" + File.separator + "Procontracer",
 			"libraries" + File.separator + "Wire",
@@ -87,28 +91,32 @@
 			"build" + File.separator + "WString.cpp.o", };
 
 	// アーカイバコマンドの設定
-	private static final String Archiver = "hardware" + File.separator
-			+ "tools" + File.separator + "avr" + File.separator + "bin"
-			+ File.separator + "avr-ar";
+    //	private static final String Archiver = "hardware" + File.separator
+    //			+ "tools" + File.separator + "avr" + File.separator + "bin"
+    //			+ File.separator + "avr-ar";
+        private static final String Archiver = "avr-ar";
 	private static final String ArchiverOption = "rcs";
 	private static final String ArchiverFile = "build" + File.separator
 			+ "core.a";
 
 	// リンカコマンドの設定
-	private static final String Linker = "hardware" + File.separator + "tools"
-			+ File.separator + "avr" + File.separator + "bin" + File.separator
-			+ "avr-gcc";
+    //	private static final String Linker = "hardware" + File.separator + "tools"
+    //			+ File.separator + "avr" + File.separator + "bin" + File.separator
+    //			+ "avr-gcc";
+        private static final String Linker = "avr-gcc";
 	private static final String LinkerOption = "-Os -Wl,--gc-sections -mmcu=atmega168";
 	private static final String LinkFile = "build" + File.separator + "Servo"
 			+ File.separator + "Servo.cpp.o";
 	private static final String ElfFile = "build" + File.separator + ""
-			+ SourceFile + ".elf";
-	private static final String LinkDirectory = "build -lm";
+  	                + SourceFile + ".elf" ;
+	                
+	private static final String LinkDirectory = "build -L../common/tools/hardware/tools/avr/lib/avr/lib/avr5 -lm";
 
 	// オブジェクトコピーコマンドの設定
-	private static final String Objcopy = "hardware" + File.separator + "tools"
-			+ File.separator + "avr" + File.separator + "bin" + File.separator
-			+ "avr-objcopy";
+    //	private static final String Objcopy = "hardware" + File.separator + "tools"
+    //			+ File.separator + "avr" + File.separator + "bin" + File.separator
+    //			+ "avr-objcopy";
+        private static final String Objcopy = "avr-objcopy";
 	private static final String ObjcopyOption1 = "-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0";
 	private static final String EepFile = "build" + File.separator + ""
 			+ SourceFile + ".eep";
@@ -117,18 +125,20 @@
 			+ SourceFile + ".hex";
 
 	// 転送コマンドの設定
-	private static final String Transfer = "hardware" + File.separator
-			+ "tools" + File.separator + "avr" + File.separator + "bin"
-			+ File.separator + "avrdude";
+	//private static final String Transfer = "hardware" + File.separator
+    //			+ "tools" + File.separator + "avr" + File.separator + "bin"
+    //			+ File.separator + "avrdude";
+        private static final String Transfer = "avrdude";
 	private static final String ConfFile = "hardware" + File.separator
 			+ "tools" + File.separator + "avr" + File.separator + "etc"
 			+ File.separator + "avrdude.conf";
 	private static final String TransferOption = "-v -v -v -v -patmega168 -carduino -b115200 -D";
 
 	// ダンプコマンドの設定
-	private static final String ObjDump = "hardware" + File.separator + "tools"
-			+ File.separator + "avr" + File.separator + "bin" + File.separator
-			+ "avr-objdump";
+    //	private static final String ObjDump = "hardware" + File.separator + "tools"
+    //			+ File.separator + "avr" + File.separator + "bin" + File.separator
+    //			+ "avr-objdump";
+    private static final String ObjDump = "avr-objdump";
 //	private static final String ObjDumpOption = "-h";
 
 
@@ -376,7 +386,8 @@
             int ret;                            // 戻り値用
 
             // コンパイル実行
-            exe = ArduinoSystemPath + Compiler;                           // コンパイラの設定
+	    //            exe = ArduinoSystemPath + Compiler;                           // コンパイラの設定
+	    exe = Compiler;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             System.out.println("exe: " + exe);
@@ -446,7 +457,8 @@
             System.out.println("compiler: " + ret);
 
             // アーカイバ実行
-            exe = ArduinoSystemPath + Archiver;                         // アーカイバの設定
+            //exe = ArduinoSystemPath + Archiver;                         // アーカイバの設定
+	    exe = Archiver;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             //psInfo.FileName = exe;                                      // 実行するファイル
@@ -474,7 +486,8 @@
             }
 
             // リンカ実行
-            exe = ArduinoSystemPath + Linker;                       // リンカの設定
+	    //            exe = ArduinoSystemPath + Linker;                       // リンカの設定
+	    exe = Linker;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             arg = LinkerOption + " ";
@@ -484,13 +497,14 @@
             arg += ArduinoSystemPath + ArchiverFile + " ";
             arg += "-L" + ArduinoSystemPath + LinkDirectory;
 
+	    System.out.println("Linker : " + exe + " " + arg);
+
             commands.clear();
             commands.add(exe);
             args = arg.split(" ");
             for(int i = 0; i < args.length; i++) {
             	commands.add(args[i]);
             }
-
             pb.command(commands);
             p = pb.start();
             ret = p.waitFor();
@@ -507,7 +521,8 @@
             System.out.println("linker: " + ret);
 
             // オブジェクトダンプ実行
-            exe = ArduinoSystemPath + ObjDump;                       // リンカの設定
+	    //            exe = ArduinoSystemPath + ObjDump;                       // リンカの設定
+	    exe = ObjDump;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             arg = "-h " + ArduinoSystemPath + ElfFile;
@@ -575,13 +590,16 @@
             System.out.println("objdump: " + ret);
 
             // オブジェクトコピー実行
-            exe = ArduinoSystemPath + Objcopy;
+	    //            exe = ArduinoSystemPath + Objcopy;
+	    exe = Objcopy;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             arg = ObjcopyOption1 + " ";
             arg += ArduinoSystemPath + ElfFile + " ";
             arg += ArduinoSystemPath + EepFile;
 
+	    System.out.println(exe + " " + arg);
+
             commands.clear();
             commands.add(exe);
             args = arg.split(" ");
@@ -605,13 +623,16 @@
             System.out.println("objcopy1: " + ret);
 
             // オブジェクトコピー実行
-            exe = ArduinoSystemPath + Objcopy;
+	    //            exe = ArduinoSystemPath + Objcopy;
+	    exe = Objcopy;
 			if (osName.indexOf("Windows") >= 0)
 				exe += ".exe";
             arg = ObjcopyOption2 + " ";
             arg += ArduinoSystemPath + ElfFile + " ";
             arg += ArduinoSystemPath + HexFile;
 
+	    System.out.println(exe + " " + arg);
+
             commands.clear();
             commands.add(exe);
             args = arg.split(" ");
@@ -686,7 +707,8 @@
     	
         // 転送実行
         //Debug.Write("---------- 転送処理実行 ----------\n");
-        exe = ArduinoSystemPath + Transfer;                           // ファイル転送コマンド
+	//        exe = ArduinoSystemPath + Transfer;                           // ファイル転送コマンド
+	exe = Transfer;
 		if (osName.indexOf("Windows") >= 0)
 			exe += ".exe";
         arg = "-C" + ArduinoSystemPath + ConfFile + " ";             // オプション
