-
Hi, I see an example using java -cp -jar pkl-codegen-java-0.25.2.jar -o generated example.pkl What should be the classpath for the jar? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I don't know from where you have the jar file, but in general you have to add each and every jar file to the classpath that is a dependency of the java-codegen gradle module. In your specific crash, the Kotlin jar is missing 🙃 |
Beta Was this translation helpful? Give feedback.
-
You can use the pkl-tools fat jar, which includes all the dependencies needed for codgen. Example: printf "module Example\n\nfoo: String\n" > Example.pkl
curl -o pkl-tools-0.25.2.jar https://repo1.maven.org/maven2/org/pkl-lang/pkl-tools/0.25.2/pkl-tools-0.25.2.jar
java -cp pkl-tools-0.25.2.jar org.pkl.codegen.java.Main -o generated Example.pkl |
Beta Was this translation helpful? Give feedback.
-
If you use JBang , and you can use following command for codegen. $ jbang run --main org.pkl.codegen.java.Main "org.pkl-lang:pkl-tools:0.25.2" --help or following command for cli $ jbang run --main org.pkl.codegen.java.Main "org.pkl-lang:pkl-tools:0.25.2" --help |
Beta Was this translation helpful? Give feedback.
-
Is there a way to use that from a plugin within maven? I was following another post from @linux-china but I couldn't make it work. I always get |
Beta Was this translation helpful? Give feedback.
You can use the pkl-tools fat jar, which includes all the dependencies needed for codgen.
Example: