From d0ec91b9872f0ebbcb93d8175a4c43cfe5bd0c54 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Tue, 13 Aug 2013 14:29:02 +0200 Subject: [PATCH] Updated build to require Java SE 1.7 to allow usage of the new features in Java SE 1.7 --- Makefile | 7 +++++-- README.txt | 7 +++---- build.xml | 9 +++++++-- se/sics/mspsim/emulink/EmuLink.java | 7 +++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 8bbeb079..4891da87 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Makefile for mspsim # # Needed stuff in the PATH: -# java, javac (JDK 1.6 or newer) +# java, javac (JDK 1.7 or newer) # # Under MS-DOS/Windows # A GNU compatible Make (for example Cygwin's) @@ -46,7 +46,7 @@ SPACE := ${EMPTY} ${EMPTY} LIBS := ${wildcard lib/*.jar} BUILD := build CLASSPATH=${subst ${SPACE},${SEPARATOR},$(BUILD)/ ${LIBS}} -CCARGS=-deprecation -classpath ".${SEPARATOR}${CLASSPATH}" -d $(BUILD) +CCARGS=-deprecation -Xlint:unchecked -source 1.7 -target 1.7 -classpath ".${SEPARATOR}${CLASSPATH}" -d $(BUILD) JAVAARGS=-classpath "${CLASSPATH}" @@ -196,3 +196,6 @@ $(BUILD)/%.class : %.java $(BUILD) clean: -$(RM) -r $(BUILD) + +distclean: clean + -$(RM) -f $(JARFILE) diff --git a/README.txt b/README.txt index 015c8bab..5483169b 100644 --- a/README.txt +++ b/README.txt @@ -7,9 +7,8 @@ some tools for monitoring stack, setting breakpoints, and profiling. * System requirements -You need a recent Java to run MSPSim. Java SE 1.5 or newer is -recommended. The current version of MSPSim also requires make for -compiling. +You need a recent Java to run MSPSim. Java SE 1.7 or newer is recommended. +The current version of MSPSim also requires make or ant for compiling. * Building MSPSim @@ -60,4 +59,4 @@ Run the default example on the Sky node emulator by typing: - currently the emulator runs as if it can use all memory as RAM (e.g. flash writes, etc not supported) - no DMA implementation -- timer system not 100% emulated \ No newline at end of file +- timer system not 100% emulated diff --git a/build.xml b/build.xml index be31c781..4155acb4 100644 --- a/build.xml +++ b/build.xml @@ -8,6 +8,8 @@ + + @@ -23,8 +25,11 @@ - + + + + diff --git a/se/sics/mspsim/emulink/EmuLink.java b/se/sics/mspsim/emulink/EmuLink.java index 2dd042f6..155af60e 100755 --- a/se/sics/mspsim/emulink/EmuLink.java +++ b/se/sics/mspsim/emulink/EmuLink.java @@ -324,9 +324,8 @@ protected void disconnect() { } } - public void run() throws IOException { - try { - ServerSocket serverSocket = new ServerSocket(8000); + public void run() { + try (ServerSocket serverSocket = new ServerSocket(8000)) { while(true) { @@ -356,7 +355,7 @@ public void run() throws IOException { } } - public static void main(String[] args) throws IOException { + public static void main(String[] args) { EmuLink el = new EmuLink(); el.run(); }