Alternative Java Runtimes

Comments, questions, rants, etc, that are specifically about KGS go here.
User avatar
Charlie
Lives in gote
Posts: 310
Joined: Mon Feb 06, 2012 2:19 am
Rank: EGF 4 kyu
GD Posts: 0
Location: Deutschland
Has thanked: 272 times
Been thanked: 126 times

Alternative Java Runtimes

Post 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?
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: Alternative Java Runtimes

Post 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
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
User avatar
quantumf
Lives in sente
Posts: 844
Joined: Tue Apr 20, 2010 11:36 pm
Rank: 3d
GD Posts: 422
KGS: komi
Has thanked: 180 times
Been thanked: 151 times

Re: Alternative Java Runtimes

Post 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/
levelonedev
Beginner
Posts: 8
Joined: Wed Feb 26, 2014 11:13 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: Level1Dev
OGS: LevelOneDev
Online playing schedule: Whenever.
Been thanked: 2 times
Contact:

Re: Alternative Java Runtimes

Post 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.
User avatar
Charlie
Lives in gote
Posts: 310
Joined: Mon Feb 06, 2012 2:19 am
Rank: EGF 4 kyu
GD Posts: 0
Location: Deutschland
Has thanked: 272 times
Been thanked: 126 times

Re: Alternative Java Runtimes

Post 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)
User avatar
quantumf
Lives in sente
Posts: 844
Joined: Tue Apr 20, 2010 11:36 pm
Rank: 3d
GD Posts: 422
KGS: komi
Has thanked: 180 times
Been thanked: 151 times

Re: Alternative Java Runtimes

Post 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.
User avatar
Charlie
Lives in gote
Posts: 310
Joined: Mon Feb 06, 2012 2:19 am
Rank: EGF 4 kyu
GD Posts: 0
Location: Deutschland
Has thanked: 272 times
Been thanked: 126 times

Re: Alternative Java Runtimes

Post 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.
User avatar
leichtloeslich
Lives in gote
Posts: 314
Joined: Wed Feb 29, 2012 1:16 pm
Rank: KGS 4k
GD Posts: 0
Location: Germany
Has thanked: 10 times
Been thanked: 128 times

Re: Alternative Java Runtimes

Post 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?
User avatar
quantumf
Lives in sente
Posts: 844
Joined: Tue Apr 20, 2010 11:36 pm
Rank: 3d
GD Posts: 422
KGS: komi
Has thanked: 180 times
Been thanked: 151 times

Re: Alternative Java Runtimes

Post 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.
User avatar
Toge
Lives in gote
Posts: 313
Joined: Tue May 18, 2010 11:11 am
Rank: KGS dan
GD Posts: 0
KGS: Toge
Has thanked: 36 times
Been thanked: 63 times

Re: Alternative Java Runtimes

Post 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.
levelonedev
Beginner
Posts: 8
Joined: Wed Feb 26, 2014 11:13 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: Level1Dev
OGS: LevelOneDev
Online playing schedule: Whenever.
Been thanked: 2 times
Contact:

Re: Alternative Java Runtimes

Post 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.
User avatar
Toge
Lives in gote
Posts: 313
Joined: Tue May 18, 2010 11:11 am
Rank: KGS dan
GD Posts: 0
KGS: Toge
Has thanked: 36 times
Been thanked: 63 times

Re: Alternative Java Runtimes

Post 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.
levelonedev
Beginner
Posts: 8
Joined: Wed Feb 26, 2014 11:13 am
Rank: KGS 10 kyu
GD Posts: 0
KGS: Level1Dev
OGS: LevelOneDev
Online playing schedule: Whenever.
Been thanked: 2 times
Contact:

Re: Alternative Java Runtimes

Post by levelonedev »

Can you post your shortcut target strings for both?
User avatar
Toge
Lives in gote
Posts: 313
Joined: Tue May 18, 2010 11:11 am
Rank: KGS dan
GD Posts: 0
KGS: Toge
Has thanked: 36 times
Been thanked: 63 times

Re: Alternative Java Runtimes

Post 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.
Javaness2
Gosei
Posts: 1545
Joined: Tue Jul 19, 2011 10:48 am
GD Posts: 0
Has thanked: 111 times
Been thanked: 322 times
Contact:

Re: Alternative Java Runtimes

Post 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?
Post Reply