Mac OS X 10.8.4, Java 7 instead of Java 6

For talk and Help about everything concerning TV-Browser.
Antworten
Vietwoojagig
Newbie
Beiträge: 5
Registriert: 16 Jul 2013, 15:13

Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Vietwoojagig »

Hi,

TV Browser always uses Java 6 of /System/Library/Java/ instead of Java 7 of /Library/Java/.
I tried a lot of things (symbolic links, etc.) but nothing worked out.
I also tried to manipulate the Info.plist in the app-package,with no success.

So how can I make TV-Browser to use my Java 7?
Gavin

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Gavin »

Similar problem on Linux. I've already got openjdk-7 installed and when updating TV Browser to the latest version it went and installed openjdk-6 before I realised it. Very annoying.
ds10
Site Admin
Beiträge: 19117
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von ds10 »

If you use the deb package format it depends on Java versions sun-java6-jre, openjdk-6-jre, sun-java7-jre, openjdk-7-jre or default-jre, recommended for all versions until 3.3.1 is sun-java6-jre. So only if your package system always installs the recommended version you will get sun-java6-jre if TV-Browser is installed. But since sun-java6-jre is not in the repositories for Ubuntu anymore it cannot be installed, so you still won't get Java 6 if one of the depend versions is available.

If you use the rpm package, it could also not happen because the dependency is Java 1.6 or higher.

So you had Java 6 all the time and simply didn't know it. Maybe you installed Java 7 but it is not used in the alternatives system, then you can select the Java version with:

Code: Alles auswählen

sudo update-alternatives --config java
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Vietwoojagig
Newbie
Beiträge: 5
Registriert: 16 Jul 2013, 15:13

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Vietwoojagig »

Nice to know that Linux has similar problems. But my question was about the OS X environment.
Can it be true that I am the only one who wants to get rid of Java 6 and is annoyed that TV-Browser is asking for it?
Vietwoojagig
Newbie
Beiträge: 5
Registriert: 16 Jul 2013, 15:13

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Vietwoojagig »

OK, since no one seems to know how to start Java 7 instead of Java 6, I tried to start TV-Browser via terminal:

Code: Alles auswählen

java -jar /Applications/TV-Browser.app/Contents/Resources/Java/tvbrowser.jar 
Result is:

Code: Alles auswählen

java.lang.NullPointerException
	at tvbrowser.TVBrowser.main(TVBrowser.java:268)
And a dialog pops up:
"Please start TV-Browser inside the TV-Browser Folder".

How do I have to modify the terminal command that TV-Browser starts inside the TV-Browser Folder?
Vietwoojagig
Newbie
Beiträge: 5
Registriert: 16 Jul 2013, 15:13

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Vietwoojagig »

OK, i was able to start TV-Browser with Java 7 inside OS X:

Code: Alles auswählen

cd /Applications/TV-Browser.app/Contents/Resources/
java -jar Java/tvbrowser.jar
Now I have to check, why all my channel settings are gone.
v6ph1
Site Admin
Beiträge: 1276
Registriert: 13 Jan 2008, 05:07
Wohnort: Radebeul

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von v6ph1 »

You have to select the correct settings folder:

http://enwiki.tvbrowser.org/index.php/How_to_start
http://enwiki.tvbrowser.org/index.php/Home_directory

best regards
v6ph1
Vietwoojagig
Newbie
Beiträge: 5
Registriert: 16 Jul 2013, 15:13

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Vietwoojagig »

Now I know the reason, why TV-Browser uses Java 6 instead of Java 7 on a Mac:

The problem is the JavaApplicationStub in TV-Browser.app/Contents/MacOS/
This stub is not compatible to Java 7.

This is what I found in the Internet about the creation of a correct stub:
Launching the app with the current JavaApplicationStub is not possible since it does not recognise Java 1.7.
Bundled applications that want to use Java 7 will need to include their own copy of JRE 7 or locate the Oracle-installed shared JRE 7.
We will have to move from building our own OSX application packages to using appbundler --> http://java.net/projects/appbundler
Appbundler includes an ant task for bundling a JRE and using a launcher stub that will find either the embedded JRE or the shared JRE.
I'm not a developer, but maybe this helps to create a Java7 compatible OS X version:
http://stackoverflow.com/questions/1210 ... ar-for-mac
ds10
Site Admin
Beiträge: 19117
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von ds10 »

The problem is that all developers with a Mac have left the team, so we cannot develop for Mac. But if someone sends us a patch we could apply it.

[ Post made via Android ] Bild
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
vn

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von vn »

What build system do you use for TV-Browser? Maven? Ant? Gradle? ...?
v6ph1
Site Admin
Beiträge: 1276
Registriert: 13 Jan 2008, 05:07
Wohnort: Radebeul

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von v6ph1 »

vn hat geschrieben:What build system do you use for TV-Browser? Maven? Ant? Gradle? ...?
Ant - as you can read within the wiki: http://enwiki.tvbrowser.org/index.php/T ... uild_Guide
Benutzeravatar
Siggi
Moderator
Beiträge: 2272
Registriert: 31 Dez 2003, 12:21
Wohnort: Doberlug - Kirchhain

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von Siggi »

.... and Maven for plugins.
mfg Siggi

PS: Wer Fehler findet, darf Sie behalten!!! :-)
vn

Re: Mac OS X 10.8.4, Java 7 instead of Java 6

Beitrag von vn »

Looks like a solution can be found at github.com/tofi86/universalJavaApplicationStub

Especially following description:
Just place the universalJavaApplicationStub from this repo in your build resources folder and link it in your ANT task (attribute executableName):
<appbundler
name="Your-App"
displayname="Your Application"
icon="${resources.dir}/icon.icns"
executableName="${resources.dir}/universalJavaApplicationStub"
... >
</appbundler>
The ANT task will care about the rest...
You should get a fully functional Mac Application Bundle working with both Java distributions from Apple and Oracle.
Antworten