Skip to content

Unable to Build With gradle build #3

Open

Description

@DivyanshByte

How to Build This Program with gradle? i am unable to do it.

Activity

  1. StartForKiller commented on May 21, 2021

    @StartForKiller
    Owner

    Then share the error that the build gives

  2. DivyanshByte commented on May 21, 2021

    @DivyanshByte
    Author

    I tried building the app using gradle build
    but i am getting no jar files in build folder except in the libs folder there is a Minecraft-1.0.0_Snapshot.jar
    So How to get the Jar file

  3. samuelh2005 commented on May 22, 2021

    @samuelh2005

    That is the jar

  4. samuelh2005 commented on May 22, 2021

    @samuelh2005

    Thats how gradle works

  5. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    No it is not running and giving error no manifest found

  6. samuelh2005 commented on May 22, 2021

    @samuelh2005

    Then the gradle file is wrong,

  7. samuelh2005 commented on May 22, 2021

    @samuelh2005

    the mainclass is not being set

  8. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    So Can You Give me the product file made afterwards or you can convert this to maven project or pom.xml bcoz i tried to change some things in the gradle but it don't work

  9. samuelh2005 commented on May 22, 2021

    @samuelh2005

    add this to the bottom of build.gradle

    mainClassName = "io.github.startforkiller.jminecraft.game.Main"
    
    project.configurations.implementation.setCanBeResolved(true)
    jar {
        manifest {
            attributes(
                    "Main-Class": "$mainClassName",
                    "Class-Path":  configurations.implementation.collect { it.name }.join(' ')
            )
    
        }
    
        dependsOn ('dependencies')
    
        from {
            configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
        }
    }
    

    And then run using the jar task insted

  10. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    Ok Thanks You Can Also Add This in the repository as a new commit to help new ones Closing This Now. :)

  11. StartForKiller commented on May 22, 2021

    @StartForKiller
    Owner

    Yeah, i haven't put the mainclass on the gradle build, because i always work with intellij that runs without it, i should add it

  12. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    So How Can I open It In Intellij There it was also not opening

  13. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    This is Not Even Working Now With your changes it's giving Could not set unknown property 'mainClassName' for root project 'Minecraft' of type org.gradle.api.Project.

  14. 5 remaining items

  15. samuelh2005 commented on May 22, 2021

    @samuelh2005

    im on mac to

  16. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    How do you made it work?

  17. samuelh2005 commented on May 22, 2021

    @samuelh2005

    if you want to see my build.gradle however it is a different project, but you can stitch the two build.gradles togther

  18. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    Ok You Can Give It to me

  19. samuelh2005 commented on May 22, 2021

    @samuelh2005

    its the link

  20. samuelh2005 commented on May 22, 2021

    @samuelh2005
  21. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    Ok

  22. samuelh2005 commented on May 22, 2021

    @samuelh2005

    and run the jar task, since i just use an IDE i can just press the button to do so

  23. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    No it is still giving the same error

  24. samuelh2005 commented on May 22, 2021

    @samuelh2005

    dont know then :(

  25. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    You Can give me the build jar to test it

  26. samuelh2005 commented on May 22, 2021

    @samuelh2005

    i have not built this one yet

  27. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    so how are you testing it?

  28. samuelh2005 commented on May 22, 2021

    @samuelh2005

    Im not, just seeing what this one is missing

  29. DivyanshByte commented on May 22, 2021

    @DivyanshByte
    Author

    Oh Btw Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions