gressil icon indicating copy to clipboard operation
gressil copied to clipboard

JvmBasedArgvFinder: sun.java.command not available on OpenJDK6 JVM

Open mgodave opened this issue 13 years ago • 8 comments

Cannot find sun.java.command system property on OpenJDK6, this causes a NPE

Exception in thread "main" java.lang.NullPointerException at org.skife.gressil.JvmBasedArgvFinder.getArgv(JvmBasedArgvFinder.java:58) at org.skife.gressil.Daemon.buildARGV(Daemon.java:164) at org.skife.gressil.Daemon.forkish(Daemon.java:131) at org.skife.gressil.Daemon.daemonize(Daemon.java:148)

mgodave avatar Apr 18 '12 21:04 mgodave

I am working on a work-around.

mgodave avatar Apr 18 '12 22:04 mgodave

Awesome, thank you! i wish there were a godo way to get at the native ARGV :-(

Let me know if you get stumped, I can set up a dev env with OpenJDK to explore. Sadly, main env is Mac, so no OpenJDK6 :-(

brianm avatar Apr 18 '12 23:04 brianm

I have been using it fine with OpenJDK 1.7 on Ubuntu, fwiw :-(

brianm avatar Apr 19 '12 01:04 brianm

I found where the java launcher sets this up in OpenJDK 7, but sadly I also found where it isn't setting it up in OpenJDK 6. I have not found anythign analogous in OpenJDK6 yet.

http://hg.openjdk.java.net/jdk7/jdk7//hotspot/raw-file/jdk7-b24/src/os/linux/launcher/java.c

That said, things seem to have been rearranged since b24, so still poking

brianm avatar Apr 19 '12 02:04 brianm

Wow. You're fast. I'll be able to take a look tomorrow.

mgodave avatar Apr 19 '12 02:04 mgodave

Okay, found the launcher in the jdk6 tree, it has the same line to set things up

http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/69fbcc78346e/src/share/bin/java.c

lines 324 and 1597

brianm avatar Apr 19 '12 02:04 brianm

BTW, I am in need of being able to change the user and group of the spawned process. I was looking through the posix_spawn manpage and it looks like that's easily accomplished through the system call itself. I was planning on implementing that tomorrow (or Friday), is that something you would be interested in?

mgodave avatar Apr 19 '12 02:04 mgodave

On Apr 18, 2012, at 8:52 PM, [email protected] wrote:

BTW, I am in need of being able to change the user and group of the spawned process. I was looking through the posix_spawn manpage and it looks like that's easily accomplished through the system call itself. I was planning on implementing that tomorrow (or Friday), is that something you would be interested in?

Heck yes!


Reply to this email directly or view it on GitHub: https://github.com/brianm/gressil/issues/1#issuecomment-5213918

brianm avatar Apr 19 '12 03:04 brianm