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

NullPointerException when running the newly built jar #24

Open
joshattr opened this issue Nov 4, 2015 · 1 comment
Open

NullPointerException when running the newly built jar #24

joshattr opened this issue Nov 4, 2015 · 1 comment

Comments

@joshattr
Copy link

joshattr commented Nov 4, 2015

Hello, I'm getting the following output when running a jar built with this plugin:

[Boot] INFO:  setProperties(com.simontuffs.onejar.JarClassLoader@6e0be858)
[Boot] INFO:  using JarClassLoader: com.simontuffs.onejar.JarClassLoader
Exception in thread "main" java.lang.NullPointerException
    at java.lang.String.replace(String.java:2240)
    at com.simontuffs.onejar.JarClassLoader.replaceProps(JarClassLoader.java:501)
    at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:349)
    at com.simontuffs.onejar.JarClassLoader.load(JarClassLoader.java:319)
    at com.simontuffs.onejar.Boot.run(Boot.java:295)
    at com.simontuffs.onejar.Boot.main(Boot.java:161)

Here are the relevant pieces of my build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'com.github.rholder', name: 'gradle-one-jar', version: '1.0.4'
    }
}

// ...

task uberjar(type: OneJar) {
    mainClass = 'my.Main'
}

Here's some relevant discussion. This may just be my issue, as I'm new to gradle... but I don't think it is. Let me know if I can help debug!

@kriegaex
Copy link

kriegaex commented Aug 4, 2018

I am not a Gradle user, but a Maven guy. Anyway, I also had problems getting One-JAR working with BouncyCastle-based project. This was due to the fact that BC JARs are signed, my own are not. So I used JDotSoft JarClassLoader. As I did not want to copy the source code into each of my projects, I released it as a JAR on Maven Central. My own repo contains usage instructions:

https://github.com/kriegaex/JarClassLoader

So you can use it and do something similar from Gradle.

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

2 participants