Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1800] Support Java 8 #743

Closed
wants to merge 3 commits into from
Closed

[#1800] Support Java 8 #743

wants to merge 3 commits into from

Conversation

asolntsev
Copy link
Contributor

We want to run Play1 applications with Java 8.
The first problem is that "-XX:-UseSplitVerifier" option is not supported by Java8.
I suggest using "-noverify" option instead of "-XX:-UseSplitVerifier" - it should work with both Java7 and Java8.

(Using "-noverify" option instead of "-XX:-UseSplitVerifier" - it works with both Java7 and Java8)
@cloudbees-pull-request-builder

play-1-3-x-pull-requests #178 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

play-1-3-x-pull-requests #179 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

play-1-3-x-pull-requests #180 FAILURE
Looks like there's a problem with this pull request

@asolntsev
Copy link
Contributor Author

Hi!
I have created an issue for this pull request: http://play.lighthouseapp.com/projects/57987-play-framework/tickets/1800-support-java-8

Can you now merge it?

@xael-fry xael-fry changed the title Support Java 8 [#1800] Support Java 8 Apr 13, 2014
@Peksa
Copy link

Peksa commented Apr 14, 2014

This only allows Play to run with Java 8, right? It doesn't allow us to use Java 8 features in our projects?

With your branch and a simple controller using Java 8 streams & lambdas as follows:

public class Application extends Controller {
    public static void index() {
        List<Integer> doubles = Arrays.asList(1, 2, 3)
                .stream()
                .map(e -> e*2)
                .collect(Collectors.toList());
        renderJSON(doubles);
    }
}

I get:

23:43:33,738 ERROR ~ 

@6hpo18bc8
Internal Server Error (500) for request GET /

Compilation error (In /app/controllers/Application.java around line 17)
The file /app/controllers/Application.java could not be compiled. Error raised is : Syntax error on token "-", -- expected

play.exceptions.CompilationException: Syntax error on token "-", -- expected
    at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:478)
    at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:282)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:424)
    at play.Play.start(Play.java:526)
    at play.Play.detectChanges(Play.java:640)
    at play.Invoker$Invocation.init(Invoker.java:197)
    at Invocation.HTTP Request(Play!)

Pretty sure this is because of the eclipse jdt compiler that also needs to be upgraded.

@xael-fry
Copy link
Member

@Peksa Yes you are right, I looking if we can update the compiler

@xael-fry
Copy link
Member

Merge with #747.
eclipse jdt compiler update will be done in a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants