i've just tried using a webassambly in java.
I wanted to use wasmerio to achieve this but following the instructions at https://github.com/wasmerio/wasmer-java (The github page of wasmerio)
I ended up with an exception after running gradle build:
gradle build
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.wasmer:wasmer-jni-amd64-linux:0.2.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/wasmer/wasmer-jni-amd64-linux/0.2.0/wasmer-jni-amd64-linux-0.2.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 866ms
1 actionable task: 1 executed
My gradle build file look like the following:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation "org.wasmer:wasmer-jni-amd64-linux:0.2.0"
}
test {
useJUnitPlatform()
}
Any Ideas?
Thanks in advance
Related
I am a beginner with Gradle projects and am struggling to build a project.
I am receiving this error when running gradle -PmainClass run:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve com.google.guava:guava:28.2-jre.
Required by:
project :
> Could not resolve com.google.guava:guava:28.2-jre.
> Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/28.2-jre/guava-28.2-jre.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/28.2-jre/guava-28.2-jre.pom'.
> sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: timestamp check failed
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
1 actionable task: 1 executed
I am trying to run a Java application here by following the first example in this post.
For clarification, I do have an internet connection. I'm wondering if there is some sort of certificate I need.
Here is my build.gradle:
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.2-jre'
implementation files('./lib/jython-standalone-2.7.0.jar')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
application {
// Define the main class for the application.
mainClassName = 'Zumi.App'
}
Any help is appreciated. Thanks!
Add mavenCentral() to your repositories block,
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.2-jre'
implementation files('./lib/jython-standalone-2.7.0.jar')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
application {
// Define the main class for the application.
mainClassName = 'Zumi.App'
}
What is causing the problem?
I am encountering such an error in my application sale. I couldn't find anything exactly as a solution.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve androidx.core:core-ktx:+.
Required by:
project :app
> Skipped due to earlier error
> Failed to list versions for androidx.core:core-ktx.
> Unable to load Maven meta-data from https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml.
> Could not get resource 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'.
> Could not GET 'https://dl.bintray.com/kotlin/kotlin-eap/androidx/core/core-ktx/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
As #Narendra_Nath said, it is because of the bintray dependencies and Jcenter shutting down.
you can refer to this article https://blog.gradle.org/jcenter-shutdown
the solution that worked for me is changing the repositories in the (Top-level build.gradle) to
buildscript {
repositories {
google()
mavenCentral()
maven {
url "https://repo.spring.io/release"
}
maven {
url "https://repository.jboss.org/maven2"
} }
You need to declare your dependency correctly "androidx.core:core-ktx:$core_version"
This is because bintray support is now no longer there.
Go to your project level build.gradle and comment out the
bintray dependencies in the allprojects and repositories section
Bintray Shutdown
Looking to import the eXist database, as well as additional dependencies.
What repositories work best for this requirements?
stack trace for build:
thufir#dur:~/NetBeansProjects/twitterBaseX$
thufir#dur:~/NetBeansProjects/twitterBaseX$ gradle clean build
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.exist-db.thirdparty.com.thaiopensource:jing:20151127.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
- https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://mvnrepository.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
- https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.pom
- https://jcenter.bintray.com/org/exist-db/thirdparty/com/thaiopensource/jing/20151127/jing-20151127.jar
Required by:
project : > org.exist-db:exist-core:5.2.0
> Could not find org.exist-db.thirdparty.javax.xml.xquery:xqjapi:1.0-fr.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://repo.maven.apache.org/maven2/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
- https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://mvnrepository.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
- https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.pom
- https://jcenter.bintray.com/org/exist-db/thirdparty/javax/xml/xquery/xqjapi/1.0-fr/xqjapi-1.0-fr.jar
Required by:
project : > org.exist-db:exist-core:5.2.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 2 executed
thufir#dur:~/NetBeansProjects/twitterBaseX$
it's only the import for exist-db which seems to be causing trouble:
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.4.1/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
//
//maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://mvnrepository.com/" }
jcenter()
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:27.0.1-jre'
// Use TestNG framework, also requires calling test.useTestNG() below
testImplementation 'org.testng:testng:6.14.3'
compile group: 'org.twitter4j', name: 'twitter4j-core', version: '4.0.1'
compile group: 'org.basex', name: 'basex', version: '9.2.4'
compile group: 'net.sf.xmldb-org', name: 'xmldb-api', version: '1.7.0'
// https://mvnrepository.com/artifact/org.exist-db/exist-core
compile group: 'org.exist-db', name: 'exist-core', version: '5.2.0'
}
// Define the main class for the application
mainClassName = 'twitterBaseX.App'
test {
// Use TestNG for unit tests
useTestNG()
}
as commenting out that compile group allows a clean build. Presumably it's a question of adding the correct repo's properly?
For eXist-db 5.x.x you need two repositories:
Maven Central for the eXist-db artifacts themselves.
eXist-db's Repository (http://repo.evolvedbinary.com/repository/exist-db/) for some third-party artifacts which cannot be published to Maven Central as they do not meet the requirements for Maven Central.
My build fail when i run the ./gradlew wrapper and i receive this message:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'RxRedux'.
Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project : > io.realm:realm-gradle-plugin:4.2.0
project : > io.realm:realm-gradle-plugin:4.2.0 > io.realm:realm-transformer:4.2.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Your project-level build.gradle file is requesting that com.android.tools.build:gradle:3.0.1 be added to the classpath, but it does not have google() in the list of repositories.
You want that buildscript closure to look like:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
(notice the google() line)
Trying to build my project with gradle 2.13.
Getting Error:
MUSGM186035-835:c gm$ gradle build
Version suffix : -6
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/gm/IdeaProjects/repo/a/b/c/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating project ':b:c:QGInitiator'.
> Failed to apply plugin [class 'org.gradle.api.plugins.scala.ScalaBasePlugin']
> A dependency must not be empty
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
BUILD FAILED
Total time: 8.397 secs
My build.gradle file looks like,
apply plugin: 'java'
apply plugin:'scala'//Line with error
ourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.scala-lang:scala-library:2.11.1"
}
This project is part of another project which has other gradle files. But I am not buling the parent project. Not sure what is happening with my dependency.
Stacktrace:
Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty
at org.gradle.api.internal.tasks.DefaultTaskDependency.addValue(DefaultTaskDependency.java:122)
at org.gradle.api.internal.tasks.DefaultTaskDependency.add(DefaultTaskDependency.java:115)
at org.gradle.api.internal.AbstractTask$11.run(AbstractTask.java:323)
at org.gradle.api.internal.tasks.TaskMutator.mutate(TaskMutator.java:37)
at org.gradle.api.internal.AbstractTask.dependsOn(AbstractTask.java:321)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.doCall(IdeaPlugin.groovy:229)
at org.gradle.plugins.ide.idea.IdeaPlugin$_configureForScalaPlugin_closure8.call(IdeaPlugin.groovy)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:165)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:142)
Try applying the idea plugin to the root plugin. I'm not exactly sure what's going on, but that should solve the issue.