简体   繁体   中英

Neomades Syntax error, parameterized types are only available if source level is 1.5 or greater

I've created a neomad project as a test project to run unit test based on code from my main neomad application project. The issue that I'm running into is that I encounter errors like the following:

Syntax error, static imports are only available if source level is 1.5 or greater

I've changed the java build configuration to 1.8, however I still get the same type of errors. Is it that what I'm trying to do is not possible with neomad because it transpiles Java into other languages?

 import com.neomades.app.Application;
    import com.neomades.app.Controller;
    import java.util.ArrayList;
    import java.util.List;
    import org.junit.runner.JUnitCore;
    import org.junit.runner.Result;
    import org.junit.runner.notification.Failure;


    /**
    * Entry point
    */
public class UnitTestsApp extends Application {

    public void onStart(Controller controller) {
        // first screen
        controller.pushScreen(UnitTestsScreen.class);


        controller.runOnBackgroundThread(new Runnable(){

            public void run() {

                List<Class> testCases = new ArrayList();

                //Add test cases
                testCases.add(JSONConverterTests.class);

                JUnitCore core = new JUnitCore();
                core.addListener(new TestRunListener());

                for (Class testCase : testCases)
                   {
                        RunTestCase(testCase);
                   }
            }

        });
    }


    private static void RunTestCase(Class testCase)
    {
        Result result = JUnitCore.runClasses(testCase);

    }

}

Is it that what I'm trying to do is not possible with neomad because it transpiles Java into other languages?

Unfortunately, yes.

NeoMAD 3 only supports Java 3, which means JDK level 1.3.

NeoMAD 4, which will be released Q2 2016, will introduce the support for Java 5. This will unlock many cool Java features such as generics or static imports.

But at the moment, you must keep the jdk compliance level to 1.3 in Eclipse.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM