R xlsx package error - java

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.util.zip.ZipException: invalid code -- missing end-of-block
Does anyone have this error when you try to use
dat <- read.xlsx("data.xlsx", sheetIndex=1, colIndex=colIndex, rowIndex=rowIndex)?

I had this problem with a file downloaded from the internet using R command line, for an online course. Found that apparently the download mode needs to be set properly as write-binary (wb) since xlsx is basically a binary file (zip). Who knew?
If that's what you did too, re-download the file with the mode set properly; like:
download.file(fileUrl, destfile='./data/sample.xlsx', mode='wb')

The version of java you have installed is likely incompatible with the xslx package. Try replacing your default java with the 64 bit version: https://www.java.com/en/download/faq/java_win64bit.xml.

Related

Kotlin / Native Installation Error : 'jni.h' file not found

I have openjdk-9-jdk and jre installed.
I have added folders containing JDK C lib files in Compiler args:
cCompiler.args "-I/usr/lib/jvm/java-9-openjdk-amd64/include"
cCompiler.args "-I/usr/lib/jvm/java-9-openjdk-amd64/include/linux"
in gradle files:
kotlin-native-master/Interop/Indexer/build.gradle
and
kotlin-native-master/Interop/Runtime/build.gradle
Full Error that I'm getting:
Exception in thread "main" java.lang.Error:
/tmp/tmp17962303058800124468.c:2:10: fatal error: 'jni.h' file not
found
Why is it showing this error?
Thanks!
So, I fixed this problem. Do this:
1) Open:
/home/kshitij/kotlin-native-master/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/StubGenerator.kt
2) Go to line 919 and comment: "-I$javaHome/../include/$it"
3) Now add this, just below the above commented line:
"-I/usr/lib/jvm/java-9-openjdk-amd64/include/$it"
Please add your java include path here. Don't copy paste exactly as above.
4) Save the file and run again. It should work now.

install4j: compilation failed. Reason: java.io.IOException: com/sun/codemodel/JCodeModel.build(L) contains a bytecode 00039

[install4j] WARNING: Error on output: java.io.IOException: com/sun/codemodel/JCodeModel.build(L) contains a bytecode 00039: invokeinterface InterfaceMethodref:83 Con:256 with an unsupported constant reference; please use the pass-file option on this class.
I have started getting this error suddenly while running the installer build. I have not changed any configurations.
I am unable to figure out the root cause for this issue. Can someone help? Thanks!
This is a message from Pack200, which may not be able to pack all JAR files. Maybe you have changed the JRE version. You can switch off Pack200 compression on the "General Settings->Media file" options. Alternatively, if the JAR file has the name codemodel.jar, you can create an empty file codemodel.jar.nopack to disable Pack200 compression just for that JAR file.

Java error while running maxent in biomod2

I am running maxent from R, in the package biomod2 and the following error appeared. I do not come from a technical background and wasn't sure why is this error happening. Is it a memory problem or someone said the java path is not set. But I followed the instructions to set maxent to run in R and also downloaded Java Platform, Standard Edition Development Kit and set a path for it as explained in this pdf: http://modata.ceoe.udel.edu/dev/dhaulsee/class_rcode/r_pkgmanuals/MAXENT4R_directions.pdf
I would be really grateful if you could help me understand this problem and any solution to it.
Thanks a lot
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: running command 'java' had status 1
2: running command 'java -mx512m -jar E:\bioclim_2.5min\model/maxent.jar environmentallayers
="rainfed/models/1432733200/m_47203134/Back_swd.csv"
samplesfile="rainfed/models/1432733200/m_47203134/Sp_swd.csv"
projectionlayers="rainfed/models/1432733200/m_47203134/Predictions/Pred_swd.csv"
outputdirectory="rainfed/models/1432733200/rainfed_PA1_Full_MAXENT_outputs"
outputformat=logistic redoifexists visible=FALSE linear=TRUE quadratic=TRUE
product=TRUE threshold=TRUE hinge=TRUE lq2lqptthreshold=80 l2lqthreshold=10
hingethreshold=15 beta_threshold=-1 beta_categorical=-1 beta_lqp=-1
beta_hinge=-1 defaultprevalence=0.5 autorun nowarnings notooltips
noaddsamplestobackground' had status 1
3: In file(file, "rt") :
cannot open file 'rainfed/models/1432733200/rainfed_PA1_Full_MAXENT_outputs/rainfed_PA1_
Full_Pred_swd.csv': No such file or directory
I've just manage to solve this problem - it is a problem with the file path specified. For me, I had a space in one of the folder names which was not accepted in the path to the maxent.jar file. From looking at your error, it looks like it might be the two backslashes.
E:\bioclim_2.5min\model/maxent.jar
should probably read
E:/bioclim_2.5min/model/maxent.jar

YUI compressor 2.48 windows path error

I am using YUI compressor to compress js file, but while passing the full path on Windows7 it is giving error
java -jar c:\yui\yuicompressor-2.4.8.jar c:\js\CCOM.js -o c:\js\CCOMA.js
gives Error as follows
java.io.FileNotFoundException: yuiCCOMA.js:\yui\CCOM.js (The filena
me, directory name, or volume label syntax is incorrect)
the jar and source file do exist and it works fine when I run it directly from source directory
This is due to a bug in Version 2.4.8:
https://github.com/yui/yuicompressor/issues/111
https://github.com/yui/yuicompressor/issues/78
Until that is fixed, you can use 2.4.7 from here: https://github.com/yui/yuicompressor/downloads

com.sun.star.lang.IllegalArgumentException - Unsupported URL <file:///

Hi Stackoverflow community, i am having an issue about reading a file from my java webapp. I want to get a file from a directory in my webapp, then converting it to PDF. Everything works just fine in my developpement environement ( Windows) but when i am puting this on sever ( LINUX), when the server reach the code to read my doc file to convert it, java throw this exception :
com.sun.star.lang.IllegalArgumentException - Unsupported URL <file:///
Here is the code :
fileDocToConvert = new File(GET_REAL_PATH()+repo_Name+slash+fileName);
fileDocToConvert path become then : /usr/share/tomcat7/webapps/myapp/repo_name/exemple.doc
the exception fired up when i try to convert :
OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
connection.connect();
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
//HERE...=> // converter.convert(docFile, pdfFile);
I am using :
jodConverter 2.2.1, openOffice 3, Java7, Tomcat 7
I start the openOffice service this way :
soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard
I can't get a way to follow to solve this issue.
Thank you in advance
I resolved the problem, by installing some missing components of OpenOffice ( Calc, Writer ). The problem was that OpenOffice can't understand the path of the file given to it.
Thank's for your help millimoose.
Have got java.lang.Exception: Unsupported URL <file:////... error message when started multiple libreoffice instances from different users and with conflicting same port setting.
The problem for me was that OpenOffice or another program that uses components of OpenOffice in it cannot understand the path of the file given to it as a place to save the file. Save the file that you are trying to save somewhere else on your computer and see if that works.

Categories

Resources