diff --git a/Sparkle.hs b/Sparkle.hs
--- a/Sparkle.hs
+++ b/Sparkle.hs
@@ -6,7 +6,7 @@
 import qualified Data.ByteString.Lazy as BS
 import Paths_sparkle
 import System.Environment (getArgs)
-import System.FilePath ((</>), (<.>), takeBaseName)
+import System.FilePath ((</>), (<.>), takeBaseName, takeFileName)
 import System.Info (os)
 import System.IO (hPutStrLn, stderr)
 import System.Process (readProcess)
@@ -36,7 +36,7 @@
         newjarbytes = fromArchive $ addEntryToArchive appzip (toArchive jarbytes)
     BS.writeFile ("." </> takeBaseName cmd <.> "jar") newjarbytes
   where
-    mkEntry file = toEntry (takeBaseName file) 0 <$> BS.readFile file
+    mkEntry file = toEntry (takeFileName file) 0 <$> BS.readFile file
 
 main :: IO ()
 main = do
diff --git a/build/libs/sparkle.jar b/build/libs/sparkle.jar
Binary files a/build/libs/sparkle.jar and b/build/libs/sparkle.jar differ
diff --git a/cbits/io_tweag_sparkle_Sparkle.h b/cbits/io_tweag_sparkle_Sparkle.h
new file mode 100644
--- /dev/null
+++ b/cbits/io_tweag_sparkle_Sparkle.h
@@ -0,0 +1,53 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class io_tweag_sparkle_Sparkle */
+
+#ifndef _Included_io_tweag_sparkle_Sparkle
+#define _Included_io_tweag_sparkle_Sparkle
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     io_tweag_sparkle_Sparkle
+ * Method:    sparkMain
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_io_tweag_sparkle_Sparkle_sparkMain
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     io_tweag_sparkle_Sparkle
+ * Method:    initializeHaskellRTS
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_io_tweag_sparkle_Sparkle_initializeHaskellRTS
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     io_tweag_sparkle_Sparkle
+ * Method:    finalizeHaskellRTS
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_io_tweag_sparkle_Sparkle_finalizeHaskellRTS
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     io_tweag_sparkle_Sparkle
+ * Method:    apply
+ * Signature: ([B[Ljava/lang/Object;)Ljava/lang/Object;
+ */
+JNIEXPORT jobject JNICALL Java_io_tweag_sparkle_Sparkle_apply
+  (JNIEnv *, jclass, jbyteArray, jobjectArray);
+
+/*
+ * Class:     io_tweag_sparkle_Sparkle
+ * Method:    invoke
+ * Signature: ([B[Ljava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL Java_io_tweag_sparkle_Sparkle_invoke
+  (JNIEnv *, jclass, jbyteArray, jobjectArray);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/sparkle.cabal b/sparkle.cabal
--- a/sparkle.cabal
+++ b/sparkle.cabal
@@ -1,5 +1,5 @@
 name:                sparkle
-version:             0.1
+version:             0.1.0.1
 synopsis:            Distributed Apache Spark applications in Haskell
 description:         See README.md
 license:             BSD3
@@ -11,6 +11,7 @@
 build-type:          Custom
 cabal-version:       >=1.10
 extra-source-files:
+  cbits/io_tweag_sparkle_Sparkle.h
   src/main/java/io/tweag/sparkle/Sparkle.java
   src/main/java/io/tweag/sparkle/SparkMain.java
   src/main/java/io/tweag/sparkle/function/HaskellVoidFunction.java
diff --git a/src/Control/Distributed/Spark/Context.hs b/src/Control/Distributed/Spark/Context.hs
--- a/src/Control/Distributed/Spark/Context.hs
+++ b/src/Control/Distributed/Spark/Context.hs
@@ -51,3 +51,10 @@
 master sc = do
   res <- call sc "master" []
   reify res
+
+getOrCreate :: SparkConf -> IO SparkContext
+getOrCreate cnf = do
+  scalaCtx :: J ('Class "org.apache.spark.SparkContext") <-
+    callStatic (sing :: Sing "org.apache.spark.SparkContext") "getOrCreate" [coerce cnf]
+
+  callStatic (sing :: Sing "org.apache.spark.api.java.JavaSparkContext") "fromSparkContext" [coerce scalaCtx]
