I see the jbox2d Vec2 class in the repository:
http://code.google.com/p/playn/source/browse/gwtbox2d/src/org/jbox2d/common/Vec2.java
How do I make the PlayN port of JBox2D package accessible to my code? I'm using Eclipse but my project does not appear to be aware of the package.
Update:
Following the example here, I've added playn-jbox2d as a dependency in my core/pom.xml file. However, when I load my project I get the following error:
ArtifactDescriptorException: Failed to read artifact descriptor for
com.googlecode.playn:playn-jbox2d:jar:1.1.1:
ArtifactResolutionException: Could not transfer artifact
com.googlecode.playn:playn-jbox2d:pom:1.1.1 from/to central
(http://repo1.maven.org/maven2): Failed to transfer
http://repo1.maven.org/maven2/com/googlecode/playn/playn-jbox2d/1.1.1/playn-jbox2d-1.1.1.pom.
Error code 416, Requested Range Not
Satisfiable pom.xml /myproject-core line 1 Maven Dependency Problem
After a bit of a goose chase, I figured out how to enable this. Following the example here, I manually added playn-jbox2d as a dependency in my core/pom.xml file. Here is what that section of my pom.xml file now looks like:
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${playn.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-jbox2d</artifactId>
<version>${playn.version}</version>
</dependency>
</dependencies>
Then in Eclipse:
Right-click core directory in Package Explorer window > Maven > Update Dependencies
Thanks to all who offered assistance.
You need to add JBox2D library to your workspace. Follow Basic guide for importing and building JBox2D. There are instructions for eclipse as well. Or you can download JBox2D jars and add them to eclipse. Here is a tutorial how to add jars to your workspace.
Related
Maybe a newbie question...
I've been working on a LWJGL project, where I use Maven to manage dependencies. In it, I want to use some parts of the libgdx library. So I figured I will first run at least a helloworld working with it before I add it to my main project.
So in my pom.xml I have this:
<!-- https://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-backend-lwjgl -->
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-backend-lwjgl</artifactId>
<version>1.9.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx-platform -->
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-platform</artifactId>
<version>1.9.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.badlogicgames.gdx/gdx -->
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx</artifactId>
<version>1.9.11</version>
</dependency>
The other contents of the file are the same as in a working project and are 100% working.
I tried creating a separate libgdx project before that and... it didn't work. But, I saw that the code that was supposed to run the program was:
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new SomeApplicationListenerFile(), config);
}
So I used that in my maven project.
When I do "run as a Java Application", the error is the following:
Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/backends/lwjgl/LwjglApplicationConfiguration
at org.boby.RayTracing.main.Main.main(Main.java:179)
And if I do a Maven Build, it tells me that "package com.badlogic.gdx.backends.lwjgl does not exist"
I looked for that package in the jars Maven downloaded in the "Maven dependencies" folder and I found it in gdx-backend-lwjgl-1.9.11.jar - right where it should be.
The package is apparently there, but Java cannot find it. How can I fix that?
Some additional information:
Windows 10, eclipse oxygen, Maven 3.6.0, JRE 1.8.0_191, JDK 8
Thank you in advance! I've been banging my head on this for hours.
Edit: I made some progress. Looks like the "test" was messing things up so I removed those statements. Now I get the following Error:
Exception in thread "main" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx64.dll' for target: Windows 10, 64-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:125)
at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:33)
at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.load(LwjglNativesLoader.java:47)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:83)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.<init>(LwjglApplication.java:71)
at org.boby.RayTracing.main.Main.main(Main.java:178)
It looks like I need to include gdx-natives.jar in my dependencies, but I can't find a maven repository for it.
I downloaded gdx-natives.jar (saw it in a forum thread). In there, was a file named "gdx-64.dll". As I need "gdx64.dll", I just renamed the dll and now it runs.
You can let Maven do the work if you define the gdx-platform dep like this:
<dependency>
<groupId>com.badlogicgames.gdx</groupId>
<artifactId>gdx-platform</artifactId>
<version>1.9.11</version>
<classifier>natives-desktop</classifier>
</dependency>
This will load the natives jar including the gdx64.dll so you don't have to add any external jar to your project in the build path.
A side note is: if you use the standard Maven repo directory structure and you load assets with the Gdx.files.internal("fileName") statement you need to define a folder in the main/repository with the same name as the package you have your code in. (i.e. main/java/myPackage relates to /main/repository/myPackage). I struggled a bit with this because I don't normaly have to define a package folder int the repository dir.
I have a github repo that I created a Release for. While creating the release I manually added a .jar file. Lets call it exampleLibrary.jar
This would be github.com/MyExampleRepo/Releases
I have a project I want to add a dependency for to use this exampleLibrary.jar file I added in my release v1.0
This project using Ivy.xml for resolving dependencies.
To get the jar from github using maven with pom.xml I imagine it would look something like this:
<dependency>
<groupId>com.github.User</groupId>
<artifactId>Repo name</artifactId>
<version>Release tag</version>
</dependency>
How would I do this using Ivy.xml? This is what I have tried:
<dependency org="com.github" name="MyExampleRepo" rev="v1.0"/>
To resolve org.apache.sling.event.jobs,version=[1.5,2] -- Cannot be resolved error in my bundle I added the dependency in the main pom.xml. But when I try to add the same minus the version and scope in the core xml file I am getting a Failed to collect dependencies error.
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.event</artifactId>
<version>4.2.0</version>
<scope>provided</scope>
</dependency>
Error is as follows:
Failed to collect dependencies at org.apache.sling:org.apache.sling.event:jar:4.2.0: Failed to read artifact descriptor for org.apache.sling:org.apache.sling.event:jar:4.2.0: Could not transfer artifact org.apache.sling:org.apache.sling.event:pom:4.2.0 from/to cqblueprints.releases (http://dev.cqblueprints.com/nexus/content/repositories/releases/): Connection refused: connect -> [Help 1]
[ERROR]
The issue, simply, is that the repo you are using: http://dev.cqblueprints.com/nexus/content/repositories/releases/ does NOT have the artifact you are looking for org.apache.sling.event
take a look at http://dev.cqblueprints.com/nexus/content/repositories/releases/org/apache/sling/ I'd expect to see org.apache.sling.event but I don't.
You'll have to add a different repo that has the artifact, maybe Maven central or the Adobe repo.
see this: https://helpx.adobe.com/experience-manager/kb/SetUpTheAdobeMavenRepository.html
Also, the version you are specifying is 4.2.2 you have to check what version is provided by AEM by going to /system/console/bundles and looking for org.apache.sling.event and use that bundle's version.
We created client for web-service with security policy to call the other web-service by passing the required information like username,password and other information..Jdeveloper had given the support for security policy and their packages but to create the war and building the application we are using maven.
when we compile through maven it is giving the compilation errors.
Can any one suggest is there any plug in to add in the maven to compile the code..
Please click below link to see the image of compilation error :
Compilation errors in console when we run Maven
The Package weblogic.wsee.jws.jaxws.owsm is part of weblogic middleware and is installed on the modules folder.
You can add it to your maven repository for example Nexus as:
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>ws.api</artifactId>
<version>1.1.0.0</version>
</dependency>
The file is %MW_HOME%\modules\ws.api_1.1.0.0.jar
or, of course, if you don't want the hassle of going through adding artifacts to the repository:
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>ws.api</artifactId>
<version>1.1.0.0</version>
<scope>system</scope>
<systemPath>${mw.home}/modules/ws.api_1.1.0.0.jar</systemPath>
</dependency>
I am a beginner in using Maven.. I tried to add Grobid (for pdf parsing) in maven. The dependency I gave is :
<dependency>
<groupId>org.grobid</groupId>
<artifactId>grobid-core</artifactId>
<version>0.3.4</version>
</dependency>
But on building the pom it shows the following error:
[ERROR] Failed to execute goal on project Miner: Could not resolve dependencies for project Miner:war:1.0-SNAPSHOT: Failed to collect dependencies at org.grobid:grobid-core:jar:0.3.4 -> org.chasen:crfpp:jar:1.0.2: Failed to read artifact descriptor for org.chasen:crfpp:jar:1.0.2: Could not transfer artifact org.chasen:crfpp:pom:1.0.2 from/to 3rd-party-local-repo (file:///${basedir}/lib/): Repository path /${basedir}/lib does not exist, and cannot be created. -> [Help 1]
I have gone through different questions related..I tried after adding pom etc. Still it is not working.. why this error comes..do we have to do extra codes for Grobid..?
add the below repository in pom or .m2/settings.xml
<repositories>
<repository>
<id>Grobid repository</id>
<url>https://mvnrepository.com/artifact/org.grobid/grobid-core</url>
</repository>
</repositories>
Start by downloading maven from http://mirror.vorboss.net/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip
Unzip it somewhere, then assuming your're on windows
1) set an environment variable M2_HOME to point at the unziped folder.
2) add %M2_HOME%/bin to your PATH environment variable
3) go to your home directory (probably C:/Users/????? and create a .m2 folder
4) move the settings.xml file from the maven unzippped/conf directory to the directory created in step 3.
5) you may have to set the proxy element correctly in your settings.xml file
It should work.
You might be new to maven, but it explicit the problem here:
Repository path /${basedir}/lib does not exist, and cannot be created.
This means that Maven could not locate the repository path you are trying to access. Or (from the "cannot be created") can't find the directory where to save the content.
As you did not provide pom.xml to look further, you'll have to find all ${basedir}/lib path in your pom.xml and in your maven settings (default to %USERPROFILE%/.m2/settings.xml or $HOME/.m2/settings.xml), then you may want to
try with an absolute path.
use an actual HTTP repository where that dependency and child' dependencies are.
use a repository server such as Sonatype Nexus or Archiva and provide a mirror/copy of it.