JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 21.10.2017, 19:52
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 39
Question [EventScripter] sys info are wrong

Hi,

Here is a sample script:

Code:
var myEnvironment = getEnvironment(); // Get OS environment
var sep = myEnvironment.getPathSeparator();
var arch = myEnvironment.getARCHFamily();
var java = myEnvironment.getJavaVersion();
var os = myEnvironment.getOS();
var fam = myEnvironment.getOSFamily();

var iJDCoreVersion = callAPI("jd", "getCoreRevision");
var iJDVersion = callAPI("jd", "version");



sText = "arch :" + arch +
            "\r\njava version: " + java +
            "\r\nOS: " + os +
            "\r\nOS family: " + fam +
            "\r\nPath Separator: " + sep +
            "\r\nJD version: " + iJDVersion +
            "\r\nJD core version: " + iJDCoreVersion;
            
alert(sText);
It returns

arch: X86
while it is X64
java version: 18040025 yes included JRE is "1.8.0_40x64" in my portable JD
OS: WINDOWS_8 while it is windows 10
OS family: WINDOWS
Path separator: \
JD version: 34065 I can not verify, there is no ref in about dialog about it.
JD core version: 38066
Is it a bug or
  • arch is JD arch. Which would be weird since everything else is x64
  • and Windows 10 is interpreted as WINDOWS 8
Reply With Quote
  #2  
Old 23.10.2017, 09:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

arch returns generic CPU arch
Code:
NA
X86
ARM
PPC
SPARC
IA64
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 23.10.2017, 09:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Java 1.8 Update 40 is too old Windows 8.1+ changed internals. You have to install/use a newer java version
bugs.openjdk.java.net/browse/JDK-8066504
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 23.10.2017, 09:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

There is also
is64BitOS()
is64BitArch()
is64BitJava()
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 23.10.2017, 20:38
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 39
Thumbs up

Ok, I have now JD run with JRE 1.8.0.152.

Windows 10 is detected but myEnvironment.getARCHFamily() still returns x86. I'll use is64 methods.
Reply With Quote
  #6  
Old 24.10.2017, 09:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Quote:
Originally Posted by fred_gaou View Post
but myEnvironment.getARCHFamily() still returns x86. I'll use is64 methods.
I've already explained it.
Quote:
Originally Posted by Jiaz View Post
arch returns generic CPU arch
Code:
NA
X86
ARM
PPC
SPARC
IA64
We use the generic CPU arch because
-detecting the exact CPU arch is not always possible
-it brings no advantages
-you cannot use X86 or X64 alone to determine what application/bitness to use.

You can have
32Bit CPU - 32Bit OS - 32Bit Java - can run 32bit exe only, can inlucde 32bit libs only

64Bit CPU - 32Bit OS - 32Bit Java - can run 32bit exe only, can include 32bit libs only

64Bit CPU - 64Bit OS - 32Bit Java - can run 32/64bit exe, can include 32bit libs only

64Bit CPU - 64Bit OS - 64Bit Java - can run 32/64bit exe, can inlucde 64bit libs only

CPU arch helps to determine if you need to run a .exe or a elf binary .....or include a .dll or a .so ....
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 24.10.2017 at 09:35.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 20:48.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.