What Jonathon proposes as a small extension certainly makes the whole
things much more portable.
jonathan gold wrote:
> yeehaw. kohsuke -- any reason not to change
>
> cmds.add("java")
>
> to
> String pathSep = System.getProperty( "path.separator" );
> String javaBin = System.getProperty( "java.home" )
> + pathSep + "bin" + pathSep + "java";
> cmds.add(javaBin);
>
>
> jon
>
> Ryan Shoemaker - JavaSoft East wrote:
>
>> jonathan gold wrote:
>>
>>>
>>> not sure how the installer works, but if there's an exec of
>>> "/usr/bin/java", or if it allows the shell to pick the "best" java
>>> from the user's $PATH, i think that might be worth a look. maybe try
>>> to use $JAVA_HOME/bin/java first, if that variable is set?
>>>
>>
>> Jon,
>>
>> JAXB is using Kohsuke's sfx4j[1] utility to produce the bundles and it
>> looks like the code is kicking off a new java process:
>>
>> https://sfx4j.dev.java.net/source/browse/sfx4j/sfx4j/src/Setup.java?rev=1.4&view=auto&content-type=text/vnd.viewcvs-markup
>>
>>
>> // build command line
>> List cmds = new ArrayList();
>> cmds.add("java");
>> cmds.add("-jar");
>> cmds.add(jar.toString());
>> cmds.addAll(Arrays.asList(args));
>>
>> // launch java
>> Process proc = Runtime.getRuntime().exec((String[])
>> cmds.toArray(new String[cmds.size()]));
>> new Thread(new
>> Setup(System.in,proc.getOutputStream(),false)).start();
>> new Thread(new
>> Setup(proc.getInputStream(),System.out,true)).start();
>> new Thread(new
>> Setup(proc.getErrorStream(),System.err,true)).start();
>> System.exit(proc.waitFor());
>>
>> --Ryan
>>
>> [1] http://sfx4j.dev.java.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>