clab / clab/dynet

Java bindings for dynet

Open
#1,416 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.4k
Forks
701
PR merge metrics
No merged PRs in 30d

Description

How to build the source jar file?
When I import the `dynet_swigJNI_dylib.jar` and `dynet_swigJNI.jar` to Eclipse, I can use it but when I click the class name, I cannot see the source code but I have to go back to the build folder and check the source code.

=====================================================
BTW, there could be one more thing can be added to the README for Java bindings.
When I tried to build dynet using "make" command, I found the following issue.

`
Exception in thread “Thread-2” Exception in thread “Thread-6" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2608)
1 javaOptions in Test ++= Seq(“-Xms1G”,“-XX:+CMSClassUnloadingEnabled”,“-XX:+UseConcMarkSweepGC”)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at sbt.React.react(ForkTests.scala:114)
at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:74)
at java.lang.Thread.run(Thread.java:745)
java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2608)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:798)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:787)
at java.lang.Thread.run(Thread.java:745)
`

This issue is same as the issue reported in [stackoverflow](https://stackoverflow.com/questions/33287424/strange-exception-in-sbt-test)

I solved it by adding `javaOptions in Test ++= Seq("-Xms1G","-XX:+CMSClassUnloadingEnabled","-XX:+UseConcMarkSweepGC")` to `dynet/contrib/swig/build.sbt file as suggested in https://stackoverflow.com/a/48903076/2211979

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Java binding build configuration in dynet/contrib/swig/build.sbt and the README section for Java bindings. Check how dynet_swigJNI_dylib.jar and dynet_swigJNI.jar are produced, then document the source-jar workflow and the reported sbt test workaround. Done means the README explains both steps clearly and the documented build path is verifiable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.