EsotericSoftware / EsotericSoftware/kryonet
Can't build trunk from source using scar
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 411
- PR merge metrics
- No merged PRs in 30d
Description
_From [knightof...@gmail.com](https://code.google.com/u/105369197369695777131/) on May 08, 2013 11:32:43_
After getting the following exception when attempting to use host discovery on OS X 10.6.8 (Snow Leopard):
00:31 ERROR: [kryonet] Host discovery failed.
java.io.IOException: Invalid argument
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:625)
at com.esotericsoftware.kryonet.Client.broadcast(Client.java:412)
at com.esotericsoftware.kryonet.Client.discoverHosts(Client.java:455)
I found out that this is supposedly fixed in the kryonet svn trunk (r132), by surrounding the send methods with try / catch blocks. But the latest release 2.20, does not have this fix. So the only option available at this time appears to be checkout out the latest source from the svn trunk and build it myself.
I finally figured out that I need to use Scar to build the library from source. So, I checkout the latest kryonet source (136) from the svn trunk, download the latest Scar release, cp scar and scar.jar into the kryonet source folder (directory containing project.yaml), and run ./scar. Here's what I get (highly edited for brevity):
Aaron:kryonet Aaron$ ./scar
00:01 INFO: [kryonet] Target: /Users/Aaron/NetBeansProjects/target/kryonet/
00:01 INFO: [kryonet] Clean
00:01 INFO: [kryonet] Compile
/Users/Aaron/NetBeansProjects/kryonet/src/com/esotericsoftware/kryonet/KryoSerialization.java:6: package com.esotericsoftware.kryo does not exist
import com.esotericsoftware.kryo.Kryo;
^
/Users/Aaron/NetBeansProjects/kryonet/src/com/esotericsoftware/kryonet/Connection.java:14: package com.esotericsoftware.minlog does not exist
import static com.esotericsoftware.minlog.Log.*;
^
/Users/Aaron/NetBeansProjects/kryonet/src/com/esotericsoftware/kryonet/JsonSerialization.java:7: package com.esotericsoftware.jsonbeans does not exist
import com.esotericsoftware.jsonbeans.Json;
^
/Users/Aaron/NetBeansProjects/kryonet/src/com/esotericsoftware/kryonet/Connection.java:61: cannot find symbol
symbol : method trace(java.lang.String,java.lang.String)
location: class com.esotericsoftware.kryonet.Connection
if (TRACE) trace("kryonet", this + " TCP had nothing to send.");
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors
Exception in thread "main" java.lang.RuntimeException: Error executing code for project: kryonet
at com.esotericsoftware.scar.Build.executeDocument(Build.java:413)
at com.esotericsoftware.scar.Build.main(Build.java:433)
Caused by: java.lang.RuntimeException: Error executing code:
Build.build(project);
Build.oneJAR(project);
at com.esotericsoftware.scar.Scar.executeCode(Scar.java:1199)
at com.esotericsoftware.scar.Build.executeDocument(Build.java:411)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.esotericsoftware.scar.Scar.executeCode(Scar.java:1197)
... 2 more
Caused by: java.lang.RuntimeException: Error during compilation.
Source: 17 files
Classpath: /Users/Aaron/NetBeansProjects/kryonet/lib/jsonbeans-0.5.jar, /Users/Aaron/NetBeansProjects/kryonet/lib/asm-4.0.jar, /Users/Aaron/NetBeansProjects/kryonet/lib/reflectasm-1.07.jar, /Users/Aaron/NetBeansProjects/kryonet/lib/minlog-1.2.jar, /Users/Aaron/NetBeansProjects/kryonet/lib/objenesis-1.2.jar, /Users/Aaron/NetBeansProjects/kryonet/lib/kryo-debug-2.20.jar
at com.esotericsoftware.scar.Scar.compile(Scar.java:1010)
at com.esotericsoftware.scar.Build.compile(Build.java:169)
at com.esotericsoftware.scar.Build.build(Build.java:391)
at Generated.execute(Generated.java from :10)
... 7 more
Obviously it's not finding the libraries in the lib folder, which doesn't make any sense. I read a post on kryonet-users saying that all you (Nate) had to do was go to the kryonet directory and type scar. I tried to add the relevant entries to project.yaml, but I'm getting the same output no matter what I do.
Can you please explain how to build kryonet from the latest source, using scar, without these errors? Thank you!
Also, when are you going to be releasing the next version of kryonet with this bugfix, rendering this entire process unnecessary?
_Original issue: http://code.google.com/p/kryonet/issues/detail?id=33_
Contributor guide
Assessment
This issue has not been assessed yet.