warn if JAVA_HOME is not set

This commit is contained in:
fros4943 2010-03-10 12:48:35 +00:00
parent adf6263b0d
commit bffd3ca433
2 changed files with 13 additions and 3 deletions

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: GUI.java,v 1.162 2010/03/09 08:27:48 fros4943 Exp $
* $Id: GUI.java,v 1.163 2010/03/10 12:48:35 fros4943 Exp $
*/
package se.sics.cooja;
@ -3082,6 +3082,12 @@ public class GUI extends Observable {
/* Look and Feel: Nimbus */
setLookAndFeel();
/* Warn at no JAVA_HOME */
String javaHome = System.getenv().get("JAVA_HOME");
if (javaHome == null || javaHome.equals("")) {
logger.warn("JAVA_HOME environment variable not set, Contiki motes (OS-level) may not compile");
}
// Parse general command arguments
for (String element : args) {
if (element.startsWith("-contiki=")) {

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ExternalToolsDialog.java,v 1.12 2008/11/04 15:01:08 adamdunkels Exp $
* $Id: ExternalToolsDialog.java,v 1.13 2010/03/10 12:48:35 fros4943 Exp $
*/
package se.sics.cooja.dialogs;
@ -140,10 +140,14 @@ public class ExternalToolsDialog extends JDialog {
String javaHome = System.getenv().get("JAVA_HOME");
if (javaHome != null) {
javaHome = javaHome.replace(File.separatorChar, '/');
JLabel javaHomeLabel = new JLabel(" $(JAVA_HOME) maps to the environment Java home: " + javaHome);
explanations.add(javaHomeLabel);
} else {
javaHome = "[null]";
JLabel javaHomeLabel = new JLabel(" $(JAVA_HOME) maps to the environment Java home: " + javaHome);
javaHomeLabel.setForeground(Color.RED);
explanations.add(javaHomeLabel);
}
explanations.add(new JLabel(" $(JAVA_HOME) maps to the environment Java home: " + javaHome));
explanations.add(new JLabel(" $(LIBFILE) maps to the current library file being created (\"mtype1.library\")"));
explanations.add(new JLabel(" $(MAPFILE) maps to the current map file being created (\"mtype1.map\")"));
explanations.add(new JLabel(" $(ARFILE) maps to the current archive file being created (\"mtype1.a\")"));