I followed the quick start wiki doc on google code using SVN/subeclipse on Ubuntu then on windows 7 after that didnt work. Errors exist within the jbox2d-serialization project - namely regarding anything referencing org.box2d.proto.Box2D type classes. I've been searching for a couple hours on a solution and im at my wits end, i would appreciate any help very much. Thanks in advance!
Quick Start Help
JavaHi Dimitri,
It looks like they are trying to implement a save/load feature but have not yet finished the coding. If you go into Testbedmain.java you can just delete or comment out all the things having to dowith JbDeserializer and JbSerializer (which are a couple of anonymous class implementations, some declared variables, and the load/save methods).
Things work well then. Frankly, I don't want to mess with the source myself but they don't have any Javadocs to download from the GoogleCode site.... ahem.
-Spenser
It looks like they are trying to implement a save/load feature but have not yet finished the coding. If you go into Testbedmain.java you can just delete or comment out all the things having to dowith JbDeserializer and JbSerializer (which are a couple of anonymous class implementations, some declared variables, and the load/save methods).
Things work well then. Frankly, I don't want to mess with the source myself but they don't have any Javadocs to download from the GoogleCode site.... ahem.
-Spenser
Thanks for your help! That worked. I commented out as suggested and TestbedMain ran after that. Thanks again!
Now that I looked a little closer, for anyone who is interested, remove:
import org.jbox2d.serialization.pb.PbDeserializer;
import org.jbox2d.serialization.pb.PbSerializer;
and the stuff in the TestbedTest() constructor that instantiates those classes (i.e. "serializer" and "deserializer").
Good luck.
import org.jbox2d.serialization.pb.PbDeserializer;
import org.jbox2d.serialization.pb.PbSerializer;
and the stuff in the TestbedTest() constructor that instantiates those classes (i.e. "serializer" and "deserializer").
Good luck.
You need to have protobuffers installed for serialization to work, I mentioned this in the Readme. Perhaps I should put the generated sources in the repository so you don't have to have the library installed to compile. I'll work with this tonight, sorry for the confusion 🙂
edit: not serialization itself, but to build the generated sources.
edit 2: you should be fine now if you update the serialization library. The generated source file is now checked in.
edit: not serialization itself, but to build the generated sources.
edit 2: you should be fine now if you update the serialization library. The generated source file is now checked in.
Hi everyone, I'm trying to figure out how to use JBox2D to build and run custom simulations, but I fail even before starting - I can't even setup the JBox2D on my Windows 7 Eclipse Helios.
I followed the Quick Start guide and this is what I've done and the outcome:
1. I installed right versions of Subclipse and Maven plugins for Eclipse Helios.
2. I checked out http://jbox2d.googlecode.com/svn/trunk/ repository with Subclipse plugin, it found 3 folders: jbox2d-library, jbox2d-serialization, jbox2d-testbed. I've checked them all and downloaded.
3. I've went to File -> Import -> Maven 2 project , then navigated to the folder from previous step "JBox2D" which contained aforementioned 3 folders. I selected all 3 folders and pressed "Finish". This generated 3 new projects in eclipse: jbox2d-library, jbox2d-serialization, jbox2d-testbed. All of these have bunch of runtime errors and testbed/src/main/java/org.jbox2d.testbed.framework/TestbedMain.java throws a following error when trying to run it:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved to a variable
at org.jbox2d.testbed.framework.TestbedModel.<init>(TestbedModel.java:40)
at org.jbox2d.testbed.framework.TestbedMain.main(TestbedMain.java:50)
Sorry if i'm being a total newbie here, I'll appreciate any help I can get 🙁
I followed the Quick Start guide and this is what I've done and the outcome:
1. I installed right versions of Subclipse and Maven plugins for Eclipse Helios.
2. I checked out http://jbox2d.googlecode.com/svn/trunk/ repository with Subclipse plugin, it found 3 folders: jbox2d-library, jbox2d-serialization, jbox2d-testbed. I've checked them all and downloaded.
3. I've went to File -> Import -> Maven 2 project , then navigated to the folder from previous step "JBox2D" which contained aforementioned 3 folders. I selected all 3 folders and pressed "Finish". This generated 3 new projects in eclipse: jbox2d-library, jbox2d-serialization, jbox2d-testbed. All of these have bunch of runtime errors and testbed/src/main/java/org.jbox2d.testbed.framework/TestbedMain.java throws a following error when trying to run it:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved to a variable
at org.jbox2d.testbed.framework.TestbedModel.<init>(TestbedModel.java:40)
at org.jbox2d.testbed.framework.TestbedMain.main(TestbedMain.java:50)
Sorry if i'm being a total newbie here, I'll appreciate any help I can get 🙁
it looks like you're still using java 1.6. Try using 1.7
I installed JDK 7 and had to install latest Eclipse Indigo as Helios does not support 1.7 as of yet. This time arround Subversion plugin installed without throwing any messages, while Maven still showed some error while trying to install but when running "Install new software" for the second time for Maven it seemed to install correctly.
After checkingout the project and "importing existing Maven project" there were less errors but still it does not build. jbox2d-library and jbox2d-serialization have errors only in their respective pom.xml files which are the following:
jbox2d-library/pom.xml:
jbox2d-serializtion/pom.xml
jbox2d-testbed on the other hand has quite a few errors in java files as well as it's pom.xml file.
jbox2d-testbed/pom.xml
testbed folder also shows that there are errors in "src/main" folder even though there are no files in it.
If i try to run jbox2d-testbed/src/main/java/org.jbox2d.testbed.framework/TestbedMain.java the following errors are thrown in the console:
"cannot find main class in testbedMain, program will exit" and bunch of other errors
I then noticed that while running it still used jre1.6, even though in Eclipse preferences i've set Compiler compliance 1.7 and added 1.7 jre VM. So then i went into Run Configuration for TestbedMain.java file and set it to use 1.7 jre and then got the same error as before
Somehow I get the impression that Maven plugin is not installing/working properly? 🙁
After checkingout the project and "importing existing Maven project" there were less errors but still it does not build. jbox2d-library and jbox2d-serialization have errors only in their respective pom.xml files which are the following:
jbox2d-library/pom.xml:
Code:
1. Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources:default-testResources:process-test-resources)
2. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
3. Failure to transfer org.codehaus.plexus:plexus:pom:2.0.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.3 from/to central (http://repo1.maven.org/maven2): No response received after 60000
2. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
3. Failure to transfer org.codehaus.plexus:plexus:pom:2.0.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.3 from/to central (http://repo1.maven.org/maven2): No response received after 60000
jbox2d-serializtion/pom.xml
Code:
1. Failure to transfer org.codehaus.plexus:plexus:pom:2.0.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.3 from/to central (http://repo1.maven.org/maven2): No response received after 60000
2. Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources:default-testResources:process-test-resources)
3. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
2. Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources:default-testResources:process-test-resources)
3. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
jbox2d-testbed on the other hand has quite a few errors in java files as well as it's pom.xml file.
jbox2d-testbed/pom.xml
Code:
1. Failure to transfer org.codehaus.plexus:plexus:pom:2.0.3 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.3 from/to central (http://repo1.maven.org/maven2): No response received after 60000
2. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
3. Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources:default-testResources:process-test-resources)
2. Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
3. Execution default-testResources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugins:maven-resources-plugin:2.4.3:testResources:default-testResources:process-test-resources)
testbed folder also shows that there are errors in "src/main" folder even though there are no files in it.
If i try to run jbox2d-testbed/src/main/java/org.jbox2d.testbed.framework/TestbedMain.java the following errors are thrown in the console:
"cannot find main class in testbedMain, program will exit" and bunch of other errors
Code:
java.lang.UnsupportedClassVersionError: org/jbox2d/testbed/framework/TestbedMain : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
I then noticed that while running it still used jre1.6, even though in Eclipse preferences i've set Compiler compliance 1.7 and added 1.7 jre VM. So then i went into Run Configuration for TestbedMain.java file and set it to use 1.7 jre and then got the same error as before
Code:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved to a variable
at org.jbox2d.testbed.framework.TestbedModel.<init>(TestbedModel.java:40)
at org.jbox2d.testbed.framework.TestbedMain.main(TestbedMain.java:50)
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
tests cannot be resolved
The type DefaultComboBoxModel is not generic; it cannot be parameterized with arguments <TestbedModel.ListItem>
tests cannot be resolved to a variable
at org.jbox2d.testbed.framework.TestbedModel.<init>(TestbedModel.java:40)
at org.jbox2d.testbed.framework.TestbedMain.main(TestbedMain.java:50)
Somehow I get the impression that Maven plugin is not installing/working properly? 🙁
you're going to have to add the 1.7 environment to eclipse, in preferences.
But I did and it gives same errors "DefaultComboBoxModel is not generic;....."




Original thread: https://box2d.org/forum/viewtopic.php?t=7406