yesterday we migrated to windows 7 in our firm and also updated the java packages and also R (to 2.14).
Then I tried to load the xlsx package, because I rely heavly on it but i get the following error:
Error : .onAttach in attachNamespace()
Error: .jnew("org/apache/poi/xssf/usermodel/XSSFWorkbook")
I tried the following, but it did not work:
Sys.setenv(PATH=paste(Sys.getenv("PATH"),"C:\\Program Files (x86)\\Java\\jre6\\bin\\client",collapse=';'))
options(java.parameters = "-Xmx1000m")
Since I never work with java i have no clue what I can do. Can you help me?
Thank you!
sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=German_Austria.1252 LC_CTYPE=German_Austria.1252
[3] LC_MONETARY=German_Austria.1252 LC_NUMERIC=C
[5] LC_TIME=German_Austria.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xlsxjars_0.4.0 rJava_0.9-3
loaded via a namespace (and not attached):
[1] tools_2.14.1 xlsx_0.4.2
The interesting thing is, that the package XLConnect loads without problems.EDIT: Ok, it loads without problems but loading a workbook does not work:
Error: NoSuchMethodError (Java): org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;
So maybe it is really no Java problem. But I don't want to re-write all my code to XLConnect!
Nobody any ideas what I could try?
I encountered exactly the same error and found a work-around. If you specify a library location on the network to install the package into, the error occurs.
## Example where error occurs:
install.packages('xlsx', lib='\\network\R\library')
library('xlsx', lib='\\network\R\library'))
However, if you change the default location for package installation within R, then you should be able to call the package library without the error. That is, simply typing install.packages('xlsx'), and having the package install automatically to its default location, allowed the package to work properly.
Related
I'm having an issue with Oracle 11g R2 Design Center feature. When I click it, it gives me the error below:
C:\app[username]\product\11.2.0\dbhome_1\owb\bin\win32>call setowbenv.bat
WARNING: Unknown directive: SetSkipJ2SDKCheck
WARNING: Could not find jvm.cfg! in 'C:\app[username]\product\11.2.0\dbhome_1\jdk\jre\lib\jvm.cfg'
WARNING: Cannot find default VM "client" at C:\app[username]\product\11.2.0\dbhome_1\jdk
ERROR: Cannot find VM at: C:\app[username]\product\11.2.0\dbhome_1\jdk
Aborting!
I've tried many things to resolve this, as listed below:
Download 32b version of JDK (actually, I've downloaded multiple to rule out the version issue, both 32 and 64)
Point environment variable and path to JDK installation
Change sqldeveloper.cfg file to include SetJavaHome {path to JDK}
Move the jvm.cfg file to the directory it's expected to be at
Checked the paths to ensure the expected files were there
With step 4, after doing so I receive a different error message:
"Client VM is unsupported"
With step 5, after doing so I realized the path to the executable was not in:
C:\app[username]\product\11.2.0\dbhome_1\jdk
But instead in:
C:\app[username]\product\11.2.0\dbhome_1\jdk\bin
So, from all of this I feel that if I can change the path the Oracle Design Center is using to the correct path, then this should resolve. Problem is, I'm unsure where to find this. Also, if it helps I believe the Design Center uses JDeveloper, since the error suggests to view the Oracle 9i JDeveloper Install Guide at jdev\install.html. I tried going to this link but I'm not sure if it exists anymore because it took me to Google. I chose the most relevant link but still, I did not find any information regarding this issue. If anyone can help I'd be very thankful, this has been running me in circles for 3 days now.
TIA
I have tried to install the R package JavaGDon MacOS 10.14.6. My R version is 3.6.1. When I do instal.packages there is apparently no error, but when I do in R console:
library(JavaGD)
Error: package or namespace load failed for ‘JavaGD’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/JavaGD/libs/JavaGD.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/JavaGD/libs/JavaGD.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/JavaGD/libs/JavaGD.so
Reason: image not found
It should work fine in macOS 10.14.
However, make sure your R and Java environments are correctly configured.
It might be a little bit of struggle to properly configure Java in R.
I suggest to start with simple Java code:
http://www.owsiak.org/r-java-11-and-making-sure-you-can-load-rjava/
to make sure you can actually use Java inside R.
In some cases it might be required to rebuild rJava package.
http://www.owsiak.org/r-3-4-rjava-macos-and-even-more-mess/
Anyway, I guess that first step is to make sure you can actually bind these two worlds.
I am implementing liblinear in windows app using visual studio express 2013 for windows. After installing liblinear using nuget package manager(link is https://www.nuget.org/packages/Liblinear/) I was trying to use it:
using de.bwaldvogel.liblinear;
And in the code I typed :
Parameter para = new Parameter(SolverType.MCSVM_CS, 1.0 , 0.01);
but it gives error while running, stating:
An exception of type 'System.TypeLoadException'occured in FileExplorer.DLL but was not
handled in the user code.
Additional Information: Could not load type 'System.Runtime.Serialization.Iserializable
' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
If there is a handler for this exception, the program may be safely continued.
Also when nuget package is installed there are no errors but there are warnings stating
Reference to type 'System.Runtime.Serialization.ISerializable' claims it is defined in
'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\mscorlib.dll',
but it could not be found (in IKVM.OpenJDK.Core.dll)
Reference to type 'System.Runtime.Serialization.SerializationInfo' claims it is defined
in 'c:\Program Files (x86)\ReferenceAssemblies\Microsoft\Framework\WindowsPhone\v8.0
\mscorlib.dll', but it could not be found (in IKVM.OpenJDK.Core.dll)
Could anyone help me out with this? I am developing app for windows phone 8.0.
Unfortunately, the ISerializable interface is not available for Windows Phone 8.x. :( Check out the Platforms section here. This thread has additional info as well.
Is the liblinear NuGet package supposed to be supported on Windows Phone? If so, I would get in contact with the author of the package directly.
I try to save some R-dataframes into .xlsx-files using the write.xlsx function of the xlsx package like this
write.xlsx(tab,file="test",sheetName="testsheet",col.names=TRUE,row.names=FALSE,append=FALSE)
whereas the object tab is a data frame, as prooved here
> class(tab)
[1] "data.frame"
When I run the code I get the following error message
> write.xlsx(tab,file="test.xlsx",sheetName="testsheet",col.names=TRUE,row.names=FALSE,append=FALSE)
Fehler in .jcall("RJavaTools", "Z", "hasField", .jcast(x, "java/lang/Object"), :
RcallMethod: cannot determine object class
and I have no particular idea what the problem could be.
PS: I'm running R 2.14.1 in the StatET 2.0 plugin in Eclipse 3.7 on a 64bit machine.
When you work in Eclipse, you can start R using either rj - a Java terminal, or RTerm - the native R terminal.
If you are using the rj terminal and something doesn't work, try the same thing with RTerm.
I have never tried to figure out why, but a few things don't work properly in rj. This includes all use of RCOM as well as printing of the return value of system().
I use rj by default because I like the way it deals with help (amongst other benefits).
But if things don't work, I try it in RTerm. One day I'll have some spare time and I'll take it up with the author.
PS. I want to stress that I absolutely love StatET in Eclipse. These oddities or rj are very minor inconveniences in the grand scheme of things.
From my experience these kind of errors are produced when the standard rj package is installed instead of the one supplied bij the StatET developer.
Check the installation guide here:
http://www.walware.de/goto/statet
If you would happen to be using Debian or Ubuntu, you can also use the repository from OpenAnalytics to install StatET and the correct rj packages in one go.
http://deb.openanalytics.eu/howto.html
I had same problem. Two codes work with my problem:
FIRST) Convert vector to dataframe:
library(xlsx)
data <- data.frame(c(1,2,3))
write.xlsx(data, file = "C:/Users/Name/Downloads/data.xlsx")
SECOND) Use another library:
`# Using openxlsx package
library(openxlsx)
dataD1 <- data.frame(c(1,2,3))
write.xlsx(dataD1, "C:/Users/Name/Downloads/dataD1.xlsx")
I hope you have solved your problem.
I’m really having trouble installing Pl/Java on Mac, any help would be appreciated.
I’ll describe the exact steps I’ve done in accordance with the README here, but I still get some errors that I cannot resolve.
(1) I’ve downloaded this version: pljava-i686-pc-linux-gnu-pg9.0-1.4.2
(2) I’ve located three files in the directory: pljava.jar, deploy.jar, pljava.so
(3) I’ve put the two .jars inside: /Library/PostgreSQL/9.0/lib
(4) I’ve put the .so inside: /Library/PostgreSQL/9.0/data
(5) I’ve modified the postgresql.conf as follows:
dynamic_library_path = '$libdir'
custom_variable_classes = 'pljava'
pljava.classpath = '/Library/PostgreSQL/9.0/lib/pljava.jar’
(6) I’ve also tried:
dynamic_library_path = '$libdir:/Library/PostgreSQL/9.0/lib/' (as well as...)
dynamic_library_path = '$libdir:/Library/PostgreSQL/9.0/data/'
(7) I then try to run:
Select sqlj.install_jar('/Software/Libraries/test_trigger.jar', 'samples', false);
Select sqlj.set_classpath(‘public’, ‘samples’);
Although, I keep getting this error:
WARNING: java.lang.NoSuchMethodError: Method org.postgresql.pljava.internal.Portal._fetch(JZI)I not found
ERROR: Unable to register native methods
********** Error **********
ERROR: Unable to register native methods
SQL state: XX000
This sounds like an issue is in not loading the right .jar. You mentioned in your comments that you were also having a problem with appropriate environment variables specifying where to load modules. This may in fact be your main issue. It looks like the equivalent environment variable is DYLD_LIBRARY_PATH though you can get more options by looking at man dyld and obviously if you are loading the wrong .so or .jar you will get errors like this.