32-bit

How do I detect which kind of JRE is installed — 32bit vs. 64bit

烈酒焚心 提交于 2019-11-26 05:28:16
问题 During installation with an NSIS installer, I need to check which JRE (32bit vs 64bit) is installed on a system. I already know that I can check a system property \" sun.arch.data.model \", but this is Sun-specific. I\'m wondering if there is a standard solution for this. 回答1: The JVM architecture in use can be retrieved using the "os.arch" property: System.getProperty("os.arch"); The "os" part seems to be a bit of a misnomer, or perhaps the original designers did not expect JVMs to be

Find most significant bit (left-most) that is set in a bit array

混江龙づ霸主 提交于 2019-11-26 03:28:27
问题 I have a bit array implementation where the 0th index is the MSB of the first byte in an array, the 8th index is the MSB of the second byte, etc... What\'s a fast way to find the first bit that is set in this bit array? All the related solutions I have looked up find the first least significant bit, but I need the first most significant one. So, given 0x00A1, I want 8 (since it\'s the 9th bit from the left). 回答1: GCC has __builtin_clz that translates to BSR on x86/x64, CLZ on ARM, etc. and

How to compile a 32-bit binary on a 64-bit linux machine with gcc/cmake

别等时光非礼了梦想. 提交于 2019-11-26 03:05:26
问题 Is it possible to compile a project in 32-bit with cmake and gcc on a 64-bit system? It probably is, but how do I do it? When I tried it the \"ignorant\" way, without setting any parameters/flags/etc, just setting LD_LIBRARY_PATH to find the linked libraries in ~/tools/lib it seems to ignore it and only look in subdirectories named lib64 . 回答1: export CFLAGS=-m32 回答2: $ gcc test.c -o testc $ file testc testc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared

Reading 64bit Registry from a 32bit application

你说的曾经没有我的故事 提交于 2019-11-26 01:13:38
I have a c# unit test project that is compiled for AnyCPU. Our build server is a 64bit machine, and has a 64bit SQL Express instance installed. The test project uses code similar to the following to identify the path to the .MDF files: private string GetExpressPath() { RegistryKey sqlServerKey = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" ); string sqlExpressKeyName = (string) sqlServerKey.GetValue( "SQLEXPRESS" ); RegistryKey sqlInstanceSetupKey = sqlServerKey.OpenSubKey( sqlExpressKeyName + @"\Setup" ); return sqlInstanceSetupKey.GetValue(

Java 32-bit vs 64-bit compatibility

风格不统一 提交于 2019-11-26 00:59:23
问题 Will Java code built and compiled against a 32-bit JDK into 32-bit byte code work in a 64-bit JVM? Or does a 64-bit JVM require 64-bit byte code? To give a little more detail, I have code that was working in a Solaris environment running a 32-bit JVM, but now I\'m getting issues after upgrading the JDK and Weblogic Server to 64-bit. 回答1: Yes, Java bytecode (and source code) is platform independent, assuming you use platform independent libraries. 32 vs. 64 bit shouldn't matter. 回答2: I

Reading 64bit Registry from a 32bit application

我与影子孤独终老i 提交于 2019-11-26 00:59:00
问题 I have a c# unit test project that is compiled for AnyCPU. Our build server is a 64bit machine, and has a 64bit SQL Express instance installed. The test project uses code similar to the following to identify the path to the .MDF files: private string GetExpressPath() { RegistryKey sqlServerKey = Registry.LocalMachine.OpenSubKey( @\"SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL\" ); string sqlExpressKeyName = (string) sqlServerKey.GetValue( \"SQLEXPRESS\" ); RegistryKey

How can I tell if I'm running in 64-bit JVM or 32-bit JVM (from within a program)?

不羁岁月 提交于 2019-11-25 23:30:16
问题 How can I tell if the JVM in which my application runs is 32 bit or 64-bit? Specifically, what functions or properties I can used to detect this within the program? 回答1: You retrieve the system property that marks the bitness of this JVM with: System.getProperty("sun.arch.data.model"); Possible results are: "32" – 32-bit JVM "64" – 64-bit JVM "unknown" – Unknown JVM As described in the HotSpot FAQ: When writing Java code, how do I distinguish between 32 and 64-bit operation? There's no public

Java 32-bit vs 64-bit compatibility

杀马特。学长 韩版系。学妹 提交于 2019-11-25 21:29:56
Will Java code built and compiled against a 32-bit JDK into 32-bit byte code work in a 64-bit JVM? Or does a 64-bit JVM require 64-bit byte code? To give a little more detail, I have code that was working in a Solaris environment running a 32-bit JVM, but now I'm getting issues after upgrading the JDK and Weblogic Server to 64-bit. Yes, Java bytecode (and source code) is platform independent, assuming you use platform independent libraries. 32 vs. 64 bit shouldn't matter. I accidentally ran our (largeish) application on a 64bit VM rather than a 32bit VM and didn't notice until some external