SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.1k stars 217 forks source link

Error with line magic while trying to import jar #68

Open IzzyIllari opened 5 years ago

IzzyIllari commented 5 years ago

Hello, love IJava so far.

I was following the 3rd Party Dependencies in an IJava Notebook on the binder jupyter lab, and was trying to use the following

List<String> added = %jars /usr/share/java/*.jar

I have put my jar file in the notebook that I am using. Here is the file image

When I do the following

List<String> added = %jars jaw-2.0/lib/*.jar

I get this error: image

When I wanted to check this issue out at io.github.spencerpark.ijava.runtime.Magics.lineMagic(Magics.java:19) I could only find https://github.com/SpencerPark/IJava/blob/master/src/main/java/io/github/spencerpark/ijava/runtime/Magics.java but no https://github.com/SpencerPark/IJava/blob/master/src/main/java/io/github/spencerpark/ijava/runtime/Magics/lineMagic.java that might correspond with the error.

Any ideas what's going on/what I'm missing?

SpencerPark commented 5 years ago

Thanks for the detailed report @IzzyIllari. This is indeed a bug. It's coming from the glob parser when the pattern contains a *. I would consider this error message a bug as well for how poorly it conveys the problem.

Until that is patched you can use List<String> added = %jars jaw-2.0/lib/ which will add all jars from that folder.