Page 1 of 2

Alternative Java Runtimes

Posted: Fri May 02, 2014 2:24 am
by Charlie
This might be an overly optimistic question but are there any alternative Java runtimes for Windows that will...
  • Run KGS
  • ... with stone sounds (without big-ugly-hack)
  • ... without requiring me to faff about with white-lists and security settings.
  • Not ruin my PC by subjecting me to endless, weekly updates and shiteware from Ask.com

I do not have any version of Java on my new-ish laptop and refuse to install the distribution that Oracle serves.

Oh... and what's happening with the mythical browser-based KGS thing that has been promised for so long?

Re: Alternative Java Runtimes

Posted: Fri May 02, 2014 4:21 am
by Bonobo
Charlie wrote:[..]
I have no answer to your Java-related questions, but …

Oh... and what's happening with the mythical browser-based KGS thing that has been promised for so long?
see William Shubert’s dev blog on Google plus https://plus.google.com/u/0/+Gokgs/posts

Latest post there:
Shared publicly - 24 Apr 2014

It's been a while since the last update so I just thought I'd post here to say that I'm still working daily on the Android client. It's one of those things where the last 10% of the work takes 90% of the time - connecting up all the dialogs, minor functions, etc. needed. I have started on the game window but still haven't come up with a new look for it that I really like. I'll post here when I do.


Greetings, Tom

Re: Alternative Java Runtimes

Posted: Fri May 02, 2014 5:16 am
by quantumf
Charlie wrote:This might be an overly optimistic question but are there any alternative Java runtimes for Windows that will...
  • Run KGS
  • ... with stone sounds (without big-ugly-hack)
  • ... without requiring me to faff about with white-lists and security settings.
  • Not ruin my PC by subjecting me to endless, weekly updates and shiteware from Ask.com

I do not have any version of Java on my new-ish laptop and refuse to install the distribution that Oracle serves.


You can try openjdk, but the degree to which it works on Windows seem dubious. The lack of downloads from the openjdk site itself is telling. http://stackoverflow.com/questions/5991 ... windows-os

I too am horrified at the ask.com nonsense that Oracle uses by default. You can avoid it, however: http://www.zdnet.com/if-you-need-java-u ... 000010157/

Re: Alternative Java Runtimes

Posted: Fri May 02, 2014 7:32 am
by levelonedev
You can have more than one version of Java installed on your machine. I don't understand why people won't just install Java 6 and stop complaining. There are other interpreted languages that have a sharded user base because they won't move on from a major version. (Python, PHP, Ruby....)

http://www.oracle.com/technetwork/java/ ... 37-oth-JPR

It might ask you to sign up for an account. If it does just use https://www.guerrillamail.com/ to sign up for one and then forget about the account! It's not like you'll need it ever again or Oracle really needs your information.

You get stone sounds! You have no security settings to faff about with.

Once you install this I would run ONLY KGS with this JDK/JRE (Which is easy to default everything to the new version anyways). You'll need to download the cgoban.JAR from their website and then use javaw.exe to launch it with a shortcut.

If you have any questions I'll be glad to help.

Re: Alternative Java Runtimes

Posted: Thu May 08, 2014 8:57 am
by Charlie
I have had some success running Cgoban and Cgoban-h under Zulu™: A Commercialized OpenJDK™ for Windows and Linux

http://www.azulsystems.com/products/zulu

Zulu can be downloaded as a Zip file requiring absolutely zero installation and allowing javaw.exe to be executed directly and, in my opinion, that is just perfect. (It's 64-bit only but that is not a problem for me.)

Sadly, even with version 1.6, nothing I can do will make KGS stone-click sounds sound. I have tried to get big-ugly-hack to work with Zulu, I have tried the `-Dsun.sound.useNewAudioEngine="false"' trick and I have tried two different versions of Cgoban-h (found via Google)

Re: Alternative Java Runtimes

Posted: Thu May 08, 2014 1:03 pm
by quantumf
Charlie wrote:I have had some success running Cgoban and Cgoban-h under Zulu™: A Commercialized OpenJDK™ for Windows and Linux

http://www.azulsystems.com/products/zulu


Interesting find, and interesting model. I was intrigued about it's possibilities for the product I work on in real life, but sadly, Zulu is only supported on Linux and Windows, not AIX and HPUX. Should be enough for most desktop O/S's, tho.

Re: Alternative Java Runtimes

Posted: Fri May 09, 2014 1:58 am
by Charlie
I did some more hacking with Zulu and KGS, last night, attempting to resurrect the stone sounds. I ended my struggle with the `testaudio.jar' that was used in the old KGS-stone-sound thread.

In Zulu's Java SE 6, 7 or 8, without big-ugly-hack, I get output similar to this:

Code: Select all

C:\<redacted>\Downloads\KGS>zulu1.7.0_55-7.4.0.5-win64\jre\bin\java.exe -version
openjdk version "1.7.0_55"
OpenJDK Runtime Environment (Zulu 7.4.0.5-win64) (build 1.7.0_55-b13)
OpenJDK 64-Bit Server VM (Zulu 7.4.0.5-win64) (build 24.55-b03, mixed mode)

C:\<redacted>\Downloads\KGS>zulu1.7.0_55-7.4.0.5-win64\jre\bin\java.exe -jar testaudio.jar
Unable to open Java mixer.
You have the following mixers available:
  Primary Sound Driver
  Speakers (2- High Definition Audio Device)
  Speakers (2- High Definition Audio Device)
  S241HL (High Definition Audio Device)
  Port Speakers (2- High Definition Au
  Port Speakers (2- High Definition Au
  Port S241HL (High Definition Audio D
Played audio file at volume 0.0


With big-ugly-hack in ..\jre\lib\ext I get the following promising output but no sound actually plays:

Code: Select all

C:\<redacted>\Downloads\KGS>zulu1.7.0_55-7.4.0.5-win64\jre\bin\java.exe -version
openjdk version "1.7.0_55"
OpenJDK Runtime Environment (Zulu 7.4.0.5-win64) (build 1.7.0_55-b13)
OpenJDK 64-Bit Server VM (Zulu 7.4.0.5-win64) (build 24.55-b03, mixed mode)

C:\<redacted>\Downloads\KGS>zulu1.7.0_55-7.4.0.5-win64\jre\bin\java.exe -jar testaudio.jar
Played audio file at volume 0.9300098


Testing on the KGS board shows similar behaviour - no sound under either environment. I tested some other features of the KGS client and did achieve sounds. (Specifically: the test-microphone feature replayed my voice correctly.) This behaviour is consistent with the stone-click-sound bug.

Stone click sounds are the missing piece, the final unknown. If I can solve it, I will put up a simple tutorial ("How to KGS!!") explaining a minimal footprint, malware free and portable installation of this dratted client.

Re: Alternative Java Runtimes

Posted: Fri May 09, 2014 4:01 am
by leichtloeslich
Charlie wrote:If I can solve it, I will put up a simple tutorial ("How to KGS!!") explaining a minimal footprint, malware free and portable installation of this dratted client.

Didn't levelonedev do exactly that?

Re: Alternative Java Runtimes

Posted: Fri May 09, 2014 11:49 am
by quantumf
The levelonedev solution is, I think, a perfectly fine solution, but it does require the installation of (multiple versions of) Java, so is hence not a portable solution. I gather Charlie is hoping to get a solution where you can just unzip a zip file containing java, the kgs, binaries, and the appropriate launch command.

Re: Alternative Java Runtimes

Posted: Sat May 10, 2014 8:47 am
by Toge
levelonedev wrote:You can have more than one version of Java installed on your machine.


- I have Java 6 update 26 and Java 6 update 31 (64-bit). KGS works fine with stone sounds too. If I install the latest Java then CGoban loads Java 7 where stone sounds are missing.

Re: Alternative Java Runtimes

Posted: Sat May 10, 2014 7:18 pm
by levelonedev
Toge wrote:- I have Java 6 update 26 and Java 6 update 31 (64-bit). KGS works fine with stone sounds too. If I install the latest Java then CGoban loads Java 7 where stone sounds are missing.


When you install Java 7 it will set your default Java version to launch any Java program in the Java 7 VM. You can configure it to launch all your programs in 1.6 if you default it to that, but I wouldn't suggest that.

SO what you need to do is modify the shortcut for KGS to launch only that program in a Java 6 VM.
Download the JAR file so you don't web start it every time.
Step 1: Save this file somewhere sensible. "C:\Program Files\KGS\" Perhaps? http://files.gokgs.com/javaBin/cgoban.jar
Step 2: Right click Desktop -> new shortcut
Step 3: Right click shortcut -> properties
Step 4: Edit the target field so that it points to the Java.exe with the new audio parameter false and the cgoban.jar. For example

"C:\Program Files\Java\jdk1.6.0_38\bin\java.exe" -Dsun.sound.useNewAudioEngine="false" -jar "C:\Program Files\KGS\cgoban.jar"

Tada! Now only KGS runs with the out of date Java.

Re: Alternative Java Runtimes

Posted: Sun May 11, 2014 4:07 am
by Toge
I've been opening KGS with cgoban.jnlp from desktop (it shows Java 6 splash screen). Cgoban.jar opens KGS too without the splash screen.

I assume that the Java executable it's pointing to is this:
C:\Program Files\Java\jre6\bin\Java.exe

I'm not sure if that's the correct executable. There's java.exe, javacpl.exe, javaw.exe and javaws.exe
Anyway, when I made the shortcut as you said, there was a dos box that flashes briefly on the screen and cgoban didn't launch.

Re: Alternative Java Runtimes

Posted: Sun May 11, 2014 11:36 am
by levelonedev
Can you post your shortcut target strings for both?

Re: Alternative Java Runtimes

Posted: Mon May 12, 2014 6:39 am
by Toge
I put shortcut target as follows:
"C:\Program Files\Java\jre6\bin\java.exe" -Dsun.sound.useNewAudioEngine="false" "C:\Program Files\KGS\cgoban.jar"

It flashes a dos box and ends without launching CGoban.

Edit: I forgot -jar in the middle. Now it keeps that annoying dos box open and also opens CGoban. If I close the box CGoban closes too.

Re: Alternative Java Runtimes

Posted: Mon May 12, 2014 12:04 pm
by Javaness2
I would have thought you could have closed the dos prompt without killing cgoban. Strange that they seem to be linked..

Actually, I've been thinking of including this solution in the help wiki for KGS - but is it too technical?