Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when trying to run program built with Lux #60

Closed
fachammer opened this issue Oct 2, 2021 · 7 comments
Closed

Exception when trying to run program built with Lux #60

fachammer opened this issue Oct 2, 2021 · 7 comments

Comments

@fachammer
Copy link
Contributor

Hi, I'm really happy that there is a new release of Lux! So I wanted to get started and learn some basics. However, when following along chapter 1 of the book I am getting an issue when trying to run the built program. Following the steps in section 3 works fine up until step 6. I have a target folder but, first of all, there is no file target/jvm/program.jar, but there is a file called target/program.jar. However, running java -jar target/program.jar gives me the following exception:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:317)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:259)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:318)
        at java.util.jar.JarVerifier.update(JarVerifier.java:230)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
        at java.util.jar.JarFile.ensureInitialization(JarFile.java:617)
        at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
        at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:991)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)

Looking up this issue I came across this StackOverflow post which suggests that the issue can occur when packaging signed jars. Is there something I can do to fix this or should this be fixed inside of Lux?

@eduardoejp
Copy link
Member

Hello, @fachammer .

I'll look into this issue, as it's not an error I was expecting to see.

I think I might have ran into it before, during the release process, as I was testing something on the Python compiler, but it was the first and only time I ever saw it, so I chalked it up to some weird one-off occurrence.

I'll try to replicate it and see how I can fix it.

@jcranch
Copy link

jcranch commented Oct 2, 2021

If it's any help, I have been able to replicate this issue, running the new release of Lux on Debian stable.

I am also keen to start experimenting with the language, and am grateful for the efforts in the recent release to make it easier to do so.

@ahribellah
Copy link

I'm having this same issue on Windows 10. For more info, here's some of the log from the attempts to grab the repositories needed for the build. I followed the instructions in the getting started chapter.

Local successes:
  Local failures: 0: "com.github.luxlang:lux-jvm-0.6.0"
                  1: "com.github.luxlang:stdlib-0.6.0"
Remote successes:  0: "args4j:args4j-2.0.16"
                   1: "cglib:cglib-nodep-2.1_3"
                   2: "com.github.luxlang:lux-bootstrapper-0.6.0"
                   3: "com.github.luxlang:lux-jvm-0.6.0"
                   4: "com.github.luxlang:stdlib-0.6.0"
                   5: "com.google.code.findbugs:jsr305-1.3.9"
                   6: "com.google.guava:guava-14.0.1"
                   7: "com.google.javascript:closure-compiler-v20130603"
                   8: "com.google.protobuf:protobuf-java-2.4.1"
                   9: "javax.inject:javax.inject-1"
                  10: "junit:junit-3.8.1"
                  11: "junit:junit-4.1"
                  12: "junit:junit-4.11"
                  13: "junit:junit-4.4"
                  14: "org.apache.ant:ant-1.7.1"
                  15: "org.apache.ant:ant-launcher-1.7.1"
                  16: "org.clojure:clojure-1.6.0"
                  17: "org.clojure:clojurescript-0.0-2080"
                  18: "org.clojure:core.match-0.2.1"
                  19: "org.clojure:data.json-0.2.3"
                  20: "org.clojure:google-closure-library-0.0-20130212-95c19e7f0f5f"
                  21: "org.clojure:google-closure-library-third-party-0.0-20130212-95c19e7f0f5f"
                  22: "org.clojure:tools.reader-0.8.0"
                  23: "org.codehaus.janino:janino-3.0.11"
                  24: "org.easymock:easymock-2.2"
                  25: "org.easymock:easymockclassextension-2.2.1"
                  26: "org.hamcrest:hamcrest-core-1.3"
                  27: "org.json:json-20090211"
                  28: "org.mozilla:rhino-1.7R4"
                  29: "org.ow2.asm:asm-7.3.1"
                  30: "org.ow2.asm:asm-all-5.0.3"
                  31: "org.ow2.asm:asm-analysis-7.3.1"
                  32: "org.ow2.asm:asm-commons-7.3.1"
                  33: "org.ow2.asm:asm-test-7.3.1"
                  34: "org.ow2.asm:asm-tree-7.3.1"
                  35: "org.ow2.asm:asm-util-7.3.1"
                  36: "xml-apis:xml-apis-1.3.04"
 Remote failures:  0: "caja:caja-r4939"
                   1: "org.junit.jupiter:junit-jupiter-api-5.3.2"
                   2: "org.junit.jupiter:junit-jupiter-api-5.3.2"
                   3: "org.junit.jupiter:junit-jupiter-api-5.3.2"
                   4: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                   5: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                   6: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                   7: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                   8: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                   9: "org.junit.jupiter:junit-jupiter-params-5.3.2"
                  10: "xerces:xercesImpl-2.9.0"

@eduardoejp
Copy link
Member

eduardoejp commented Oct 9, 2021

Apologies for the delay.

I've been terribly busy this past week.

v0.6.2 should no longer exhibit this problem: https://github.com/LuxLang/lux/releases/tag/0.6.2

Also, please update your aedifex.jar file with the one in this release.

@eduardoejp
Copy link
Member

@fachammer

I have a target folder but, first of all, there is no file target/jvm/program.jar, but there is a file called target/program.jar.

The correct path is target/program.jar, instead of target/jvm/program.jar.

I fixed that in the book.

Thanks for pointing it out!

@fachammer
Copy link
Contributor Author

@eduardoejp I had to delete the target folder of the project where I was testing Lux before, but that is to be expected, I guess. After that, building with the new aedifex.jar seems to work now. Great!

@ahribellah
Copy link

Just following up to say that this was also fixed for me on Win10 with the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants