simple java_home environment references

This commit is contained in:
fros4943 2007-05-28 07:26:51 +00:00
parent c874d56f32
commit 46a727d8de

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: ContikiMoteTypeDialog.java,v 1.31 2007/05/19 14:27:08 fros4943 Exp $ * $Id: ContikiMoteTypeDialog.java,v 1.32 2007/05/28 07:26:51 fros4943 Exp $
*/ */
package se.sics.cooja.contikimote; package se.sics.cooja.contikimote;
@ -1369,7 +1369,7 @@ public class ContikiMoteTypeDialog extends JDialog {
if (!contikiDir.exists()) { if (!contikiDir.exists()) {
if (errorStream != null) if (errorStream != null)
errorStream.println("Bad Contiki OS path"); errorStream.println("Bad Contiki OS path");
logger.fatal("Contiki path does not exist"); logger.fatal("Contiki path does not exist: " + contikiDir.getAbsolutePath());
return false; return false;
} }
if (!contikiDir.isDirectory()) { if (!contikiDir.isDirectory()) {
@ -1421,6 +1421,12 @@ public class ContikiMoteTypeDialog extends JDialog {
String sourceFileNames = ""; String sourceFileNames = "";
String ccFlags = GUI.getExternalToolsSetting("COMPILER_ARGS", ""); String ccFlags = GUI.getExternalToolsSetting("COMPILER_ARGS", "");
// Replace Java home references
if (ccFlags.contains("$(JAVA_HOME)")) {
String javaHome = (String) System.getenv().get("JAVA_HOME");
ccFlags = ccFlags.replace("$(JAVA_HOME)", javaHome);
}
for (File sourceFile : sourceFiles) { for (File sourceFile : sourceFiles) {
if (sourceFile.isDirectory()) { if (sourceFile.isDirectory()) {
// Add directory to search path // Add directory to search path