Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

How do I set the Java version? #18

Open
khatchad opened this issue Apr 30, 2020 · 8 comments
Open

How do I set the Java version? #18

khatchad opened this issue Apr 30, 2020 · 8 comments

Comments

@khatchad
Copy link

Seems like the autograder is using a Java version less than 11. How do I specify a newer Java version?

@jeffrafter
Copy link
Contributor

Sorry for the slow reply! Yes we are using the default GitHub Actions Java version (https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners). We've been discussing ways to do this from within GitHub Classroom in the future but it is not possible right now.

To workaround this:

  1. Create an assignment with autograding setup as you would want
  2. Accept the assignment... grab the .github/workflows/classroom.yml and .github/classroom/autograding.json files
  3. Change the workflow to include the setup-java action (https://github.com/actions/setup-java)
  4. Add the files to your template repository
  5. Recreate the assignment and do not setup autograding

This is definitely super-cumbersome... but should allow you to change the workflow as you see fit.

@john-french
Copy link

john-french commented Sep 29, 2020

I had a similar problem @khatchad, I tried something like the above but found this (hacky) solution worked for me.

Scrap that. The solution @jeffrafter posted above does actually work for setting up autograding with a specific java version, and it's less cumbersome than my initial hack.

@oxzi
Copy link

oxzi commented Nov 9, 2020

Is there anything new in the meantime? I need a newer Python than version 3.6 and I find the manual customization of all student repositories tedious. The repositories can be created at any time within a week. Every week.

@john-french
Copy link

@oxzi I use a template repository with a .github folder in it, containing the classroom.yml file I need (using the setup-java action), and a template autograding.json. Any assignment repositories I create use this repo as a template. I don't need to manually customise any student repos after this, all student repos get the correct setup. You could use the setup-python action in your classroom.yml.
I can share my template repo with you if you like (it's also got a Java .gitignore in it that you could.... ignore 🙂).

@oxzi
Copy link

oxzi commented Nov 9, 2020

@john-french: Thanks! I assumed that an existing classroom.yml would be overwritten and already started building an Action to alter an existing classroom.yml file afterwards. I will try this for next week's exercise.

@john-french
Copy link

It seems not @oxzi, as long as you don't add autograding in the assignment creation GUI in github classroom

@oxzi
Copy link

oxzi commented Nov 15, 2020

@john-french: I just wanted to say thank you again. For the upcoming weekly exercise I created the two files manually in my template repository, as recommended. This way they were delivered to the students and also executed.

Of course it would be even nicer if this did not have to be done by hand. If anyone at GitHub is reading this...

@jeffrafter
Copy link
Contributor

@oxzi just wanted to note that changes to allow this were brought up within the past few weeks and I am still advocating for it. Thanks for persisting and working around the shortcomings!

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

No branches or pull requests

4 participants