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

Getting it to compile on mac High Sierra #47

Open
eafulton opened this issue Oct 7, 2019 · 1 comment
Open

Getting it to compile on mac High Sierra #47

eafulton opened this issue Oct 7, 2019 · 1 comment

Comments

@eafulton
Copy link

eafulton commented Oct 7, 2019

G'day

To get a compile from the command line call on mac High Sierra required the following code nudge to

POSEIDON-master/src/main/java/uk/ac/ox/oxfish/fisher/strategies/destination/RandomPlanFadDestinationStrategy.java

around line 55 I had to change the override to

@Override
void makeNewPlan(Fisher fisher) {

    actionQueue.addAll(Stream
        .generate(() -> oneOf(possibleActions, fisher.grabRandomizer())
            .<RuntimeException>orElseThrow(() -> new RuntimeException("No possible action!"))
                  
            // Line was .orElseThrow(() -> new RuntimeException("No possible action!"))
        )
        .filter(pair -> pair.getSecond().apply(fisher))
        .map(pair -> pair.getFirst().apply(fisher))
        .limit(numberOfStepsToPlan)
        .collect(toCollection(ArrayList::new)));
}

Without this you got a compile time error "unreported exception X; must be caught or declared to be thrown"

Cheers

Beth

@nicolaspayette
Copy link
Member

nicolaspayette commented Oct 7, 2019

Hi Beth,

Thanks for reporting this.

The method you're referring to has been refactored in 42768e9, but that commit probably wasn't yet merged into the master branch when you checked out the code. If you pull again and try to compile, it might work for you now.

That being said, I suspect that the compile error you are getting is due to this Java bug:
https://bugs.openjdk.java.net/browse/JDK-8066974

I would suggest taking a look at which Java version you have by typing java -version at the command prompt. For example, on my machine:

$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

If you have anything older than that, I would suggest upgrading your Java 8 installation.

(The most recent version of Java 8 is 1.8.0_221; I should probably upgrade too.)

@CarrKnight CarrKnight pinned this issue Oct 7, 2019
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

No branches or pull requests

2 participants