Matlab builder JA: Problems with accessing builder JA - matlab

First of all I would like to thank you for any kind of help, I try to be as clear as possible.
If I want to use MATLAB builder JA via deploytool, I have there no option to create JAVA package in deploytool GUI. I suppose that I have something wrong with settings but don't know which step exactly.
So first of all I Install MATLAB 2013a with MATLAB builder JA Version 2.2.6, I had to install corresponding version of Matlab Compiler Runtime (version v8.1) and also windows SDK 7.1. It is necessary to have proper version of JDK corresponding to Matlab version, so when I use command in Matlab:
version -java
"Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode"
So I downloaded proper version of JDK (x64bit same like my OS and MATLAB version are).
Setup a JAVA_HOME path (C:\Program Files\Java\jdk1.6.0_17) in environment variable, and also add a custom path to "Path" variable in my case:
C:\Program Files\Java\jdk1.6.0_17\bin;
C:\Program Files\MATLAB\R2013a\runtime\win64;
C:\Program Files\MATLAB\MATLAB Compiler Runtime\v81\runtime\win64;
So then when I type in MATLAB getenv JAVA_HOME I get a right path to JAVA installation, but when I type again version -java I get same response like I had with no installation of JDK. When I try to write javac -version command in Matlab, I get this response:
"Undefined function 'javac' for input arguments of type 'char'."
I also type this commands in my command line in windows, and the result was good:
"java version "1.6.0_17'
Java(TM) SE Runtime Enviroment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3.-b01, mixed mode)"
In the ideal scenario i should get same response in matlab but I don't and I have absolutely no idea why.
I was reading lots of material about it and no one has the same problem. I tried matlab 2013b too with another licence, MCR, and JDK (1.7.0_11) but with same result.
What am I doing wrong? please help.. thank you very much

Related

java web start fails to locate java runtime

Hi I am trying to run javaws but it prompts:
To open this Web Start application you need to download the Java Runtime Environment.
I am sure JRE is installed, maybe javaws does not find it, how do I fix that?
Johns-MacBook-Pro:~ johnmactavish$ java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Johns-MacBook-Pro:~ johnmactavish$ javaws
No Java runtime present, requesting install.
Unable to locate a Java Runtime to invoke.
Johns-MacBook-Pro:~ johnmactavish$
Java Web Start (javaws) was deprecated in Java 9 and removed in Java 11.
As you are using java 13, you can either downgrade from 13 to 8, or look for alternatives.
Perhaps an alternative such as https://openwebstart.com/ can help you out with that.
P.S: In case you're using tools to manage version such as sdkman or such, there might be the case where it's also not available in SDKs # version 8 provided by sdkman.

SIGSEGV signal while executing "Eclipse Application" run configuration for my Xtext project

Since my computer has been updated to Mojave (macOS), I get the following error when I am trying to execute an Xtext project (Run As -> Eclipse Application):
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007fff51115248, pid=10464, tid=775
JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
Problematic frame:
C [CoreFoundation+0x8248] CFDictionaryGetValue+0xb
No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as:
/Applications/Eclipse.app/Contents/MacOS/hs_err_pid10464.log
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Unfortunately, I do not have so much information to share.
Here my setup:
Mojave, v. 10.14.1
Eclipse DSL Tools, v: 2018-09 (4.9.0), Build id: 20180917-1800
java version "11.0.1" 2018-10-16 LTS, Oracle one
What I have tested:
Running the ulimit -c unimited command
Reinstalling Eclipse
Reinstalling my JDK. I also tested on OpenJDK.
Running on a fresh computer. I don't have the bug on macOs Sierra.
I tested the solution mention here:
how to fix “Failed to write core dump. Core dumps have been disabled” error while running java
Thanks for your help.
#Christian Dietrich: many thanks for the link!
Here the current workaround explained in the link: to add the '-nosplash' in Arguments tab of run configuration.

Missing spark file from my system?

I'm trying to run a program written in Scala that uses Apache Spark 2.0. However, I keep getting the following error:
/opt/spark-1.6.1/bin/spark-class: line 86: /usr/java/jdk1.8.0_40/bin/java: No such file or directory
Does anyone know what might be causing this?
Edit: Running the java -version command yields the following result:
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)
Edit 2: Took a peek into /usr/java and found that instead of jdk1.8.0_40, I have jdk1.8.0_101. Used export JAVA_HOME to reset it and now env displays JAVA_HOME as the correct path. It's still not working, though! Same error anyway. Do I need to run some kind of update command?

MTurk Command Line Tools Error: Bad version number in .class file

I am using the Mechanical Turk command line tools on Windows. When I try to run a command (e.g., getBalance, createQualificationType), I always get the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
Any clues as to what I could look at to fix this would be greatly appreciated!!
I have tried updating my key and secret key to no avail.
Note: I can get help for the commands by using -help, but I cannot run the commands themselves.
This error occurs whether I am running either JRE 1.5.0_06-b05, 1.5.0_22-b03, or 1.7.0_17-b02. The command line tools documentation states, "You must have the Java JRE 1.5.X (JRE 5). The Command Line Tools are not 100% compatible with JRE 6."
Since I am using the version of the command line tools packaged with JRE, I have also uninstalled my JRE. I get the same error.
UnsupportedClassVersionError means that you are trying to use a Java class that was compiled with a newer JDK on an older Java runtime environment. For example, you have a class that was compiled with JDK 7, and you are trying to use it on a Java 6 or older runtime environment.
Java is downwards compatible; newer Java runtime environments can run Java classes compiled with older versions without modifications, but not the other way around.
Check with what version the class you are trying to use was compiled, and use a Java runtime environment with the same version or newer to run the class.
You can check your Java runtime environment and JDK versions with:
java -version
javac -version
Apparently, the CLT installer installs a JRE that is too old to run the tools included in the installer. Seems like a serious bug (certainly annoying).
You can fix by installing and using a more recent JDK.
This post contains instructions on how to do so:
https://forums.aws.amazon.com/message.jspa?messageID=388586#388585

which configuration option is used by Mex to compile using matlab?

say, if choose mexopts.sh as the configuration files for mex,
then how does mex decide which option listed in the mexopts.sh is used for compiling?
for example, using 32bit matlab on 64bit mac os x:
mexopts.sh looks like:
,,maci
........
,,maci64
......
Then, maci or maci64 is used when compiling?
What commands or way can I do in order to compile 32bit lib instead of 64bit lib?
Further explanation of my process and the error message I got :
I am using mac os x 10.8 (64bit) with matlab R2010a (32bit) to produce a binary mex-file.
The Xcode is 4.6 version, I installed Command Line Tools on my machine. Then I downloaded the patch from matlab for 2011 and 2012 version anyway. (if I don't install the patch, I got a lot of link errors saying some header files are missing).
After I installed the patch ( I believe it changes my mexopts.sh file), when I run mex a.cpp, I got error message saying that /Applications/MATLAB_R2010a.app/bin/maci64 cannot be found. Of course, it cannot find the maci64 folder, it is 32bit, there is only maci folder.
So Anyone knows what I should do in order to make matlab look for maci folder instead of maci64 folder? Thanks a lot!
MATLAB does not support cross compilation of MEX files. So your 32-bit MATLAB installation should be producing 32-bit MEX files even though the OS is 64-bit.
Also, from the article I've linked
Further, beginning with R2010b, a 32-bit version of MATLAB is no longer produced for the Mac.
If you're running R2010b or later, your MATLAB is not 32-bit anyway.
To see what switches the MEX script is invoking the compiler with, use the -v option.
You can also use the file tool to check whether the generated binary is 32 or 64-bit.
As its been explained, MATLAB produces MEX files of the same bit-ness as itself, not that of the OS. This is true at least on Windows with recent MATLAB versions, where you can have either 32-bit or 64-bit MATLAB running on 64-bit Windows. Other platforms are moving towards 64-bit versions only.
Here is another way to get the configured mex switches:
>> cc = mex.getCompilerConfigurations
>> cc.Details
In my case I get:
>> cc = mex.getCompilerConfigurations
cc =
CompilerConfiguration with properties:
Name: 'Microsoft Visual C++ 2010'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '10.0'
Location: 'C:\Program Files\Microsoft Visual Studio 10.0'
Details: [1x1 mex.CompilerConfigurationDetails]
LinkerName: 'Microsoft Visual C++ 2010'
LinkerVersion: '10.0'
>> cc.Details
ans =
CompilerConfigurationDetails with properties:
CompilerExecutable: 'cl'
CompilerFlags: [1x115 char]
OptimizationFlags: '/O2 /Oy- /DNDEBUG'
DebugFlags: '/Z7'
LinkerExecutable: 'link'
LinkerFlags: [1x327 char]
LinkerOptimizationFlags: ''
LinkerDebugFlags: '/debug /PDB:"%OUTDIR%%MEX_NAME%%MEX_EXT%.pdb"'
To answer my own question, just for those who may be interested in it,
I checked the contents of mexopts.sh and modified the part for maci (specifically set ARCH=i386) , then compile. The error message is gone.