Skip to content

classpath is empty when retrieving it. #234

@JakeTheDondorian

Description

@JakeTheDondorian

I've had some problems with my build for MacOS. Who could have guessed?

Now, I need to retrieve the current classpath to be used in a ProcessBuilder. The reason for this is that I'm appending other classspaths as well as the default one.

But, when querying the classpath on mac, using the exe built by packer, it's empty. Running the jar on the mac works fine though.

It looks like this:

String classpath = System.getProperty("java.class.path");
if (classpath == null || classpath.length() == 0) {
LOG.ln("java.class.path is: '" + classpath + "'");
}

I'm building like so:

java -jar %CD%\packr\packr-all-4.0.0.jar --platform Mac --jdk %CD%\jre\javaMac.zip --executable songsofsyx --classpath SongsOfSyx.jar --mainclass init.MainLaunchLauncher --vmargs XstartOnFirstThread --resources %CD%\build\songsofsyx\base --output %CD%\out\SongsOfSyxMac\SongsOfSyxMac.app --icon %CD%\jre\icon512.icns

Now, I've tried reading the executable, but it's all just a bunch of binary data there. In the end, the executable should be doing something like this path/java -jar Myjar.jar cp - something... What do you set the cp to?

I'm also guessing double clicking a jar is this path/java -jar Myjar.jar cp - path/clickedJar.jar.

Could also be possible that if the cp argument is missing, the JVM will find it itself?

I realize this might not be a bug, but maybe someone could shed some light on these mysteries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions