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

classpath is empty when retrieving it. #234

Open
JakeTheDondorian opened this issue Jun 27, 2023 · 0 comments
Open

classpath is empty when retrieving it. #234

JakeTheDondorian opened this issue Jun 27, 2023 · 0 comments

Comments

@JakeTheDondorian
Copy link

JakeTheDondorian commented Jun 27, 2023

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?

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

1 participant