on my system, knitr can't compile a doc that uses the gdata package - knitr

My last two questions were just embarrassing, but I feel confident that this one is the real deal. My system is a new install, so versions are current except for OS: Windows 7 SP1, R-3.0.1, Lyx 2.0.6, knitr 1.2, gdata 2.12.0.2.
First, let me note that gdata works correctly in RGui. Now, here's the doc I'm trying to compile:
And here's the output.
The gdata package also loads successfully in Rscript called from the command line. I used LyX to export an .Rnw file, which knits successfully from RGui and from a script passed to Rscript from the command line.
I had a similar (or possibly the same, I cannot swear to the identity of the error message) difficulty when I first started using the computer. That time it was due to Windows 7 User Account Controls, and was solved when I figured out how to automatically run R as an administrator (with no click-through -- sweet). So I tried removing the read-only attribute and all security restrictions on anything that might be involved -- the R folder, LyX folder, my package folder, MikTeX. No luck.
What next?
ETA: As near as I can tell, no R script called from LyX can load the gdata package. I altered the file converter to write stdout and stderr to file, which yielded the same error message seen above in the screenshot, but preceded by this:
Can't locate Data/Dumper.pm in #INC (#INC contains: C:/Users/cyanofsky/Documents/R/win-library/3.0/gdata/perl C:/Program Files (x86)/MiKTeX 2.9/miktex/lib .) at C:/Users/cyanofsky/Documents/R/win-library/3.0/gdata/perl/module_tools.pl line 11.
BEGIN failed--compilation aborted at C:/Users/cyanofsky/Documents/R/win-library/3.0/gdata/perl/module_tools.pl line 11.
Compilation failed in require at C:/Users/cyanofsky/Documents/R/win-library/3.0/gdata/perl/supportedFormats.pl line 9.
running 'C:\Program Files\R\R-3.0.1\bin\x64\Rterm.exe --slave --no-restore --no-save --no-restore --file=C:/Program Files (x86)/LyX 2.0/Resources/scripts/lyxknitr.R --args C:/Users/cyanofsky/AppData/Local/Temp/lyx_tmpdir.Hp8008/lyx_tmpbuf3/xxxxxxxxx.Rnw C:/Users/cyanofsky/AppData/Local/Temp/lyx_tmpdir.Hp8008/lyx_tmpbuf3/xxxxxxxx.tex ISO-8859-15'
ETA: A search for Data/Dumper pulled up this:
http://help.directadmin.com/item.php?id=189
I verified that my install of Perl64 has the Data module; it's in C:\Perl64\lib. So this is a case where some path variable somewhere is misconfigured. It's not LyX's path prefix variable; no, no, that would be too easy.
Per Yihui's answer:
From within the GUI (in this case, RStudio):
> strsplit(Sys.getenv('PATH'), ';')
[[1]]
[1] "C:\\Program Files\\R\\R-3.0.1\\bin\\x64"
[2] "C:\\Program Files\\R\\R-3.0.1\\bin\\x64"
[3] "C:\\Perl64\\site\\bin"
[4] "C:\\Perl64\\bin"
[5] "c:\\Rtools\\bin"
[6] "c:\\Rtools\\gcc-4.6.3\\bin"
[7] "c:\\Program Files (x86)\\AMD APP\\bin\\x86_64"
[8] "c:\\Program Files (x86)\\AMD APP\\bin\\x86"
[9] "c:\\Program Files (x86)\\Intel\\iCLS Client\\"
[10] "c:\\Program Files\\Intel\\iCLS Client\\"
[11] "C:\\Windows\\system32"
[12] "C:\\Windows"
[13] "C:\\Windows\\System32\\Wbem"
[14] "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\"
[15] "c:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static"
[16] ""
[17] "C:\\Program Files\\Intel\\WiFi\\bin\\"
[18] "C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\"
[19] "C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86"
[20] "C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64"
[21] "C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\"
> Sys.which('perl')
perl
"C:\\Perl64\\bin\\perl.exe"
Here's from within the call to Rscript:
> load("~/lyxknitrpaths.RData")
> syspath
[[1]]
[1] "C:\\Program Files\\R\\R-3.0.1\\bin\\x644"
[2] "LyXDir\\bin"
[3] "$LyXDir\\Python"
[4] "$LyXDir\\Python\\Lib"
[5] "$LyXDir\\imagemagick"
[6] "C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin"
[7] "C:\\Program Files (x86)\\LyX 2.0\\ghostscript\\bin"
[8] "C:\\Perl64\\lib"
[9] "C:\\Perl64"
[10] "C:\\Program Files (x86)\\LyX 2.0\\\\Python"
[11] "C:\\Program Files (x86)\\LyX 2.0\\\\Python\\Lib"
[12] "C:\\Program Files (x86)\\LyX 2.0\\\\imagemagick"
[13] "C:\\Program Files (x86)\\LyX 2.0\\\\bin"
[14] "C:\\Program Files (x86)\\LyX 2.0\\bin\\"
[15] "C:\\Program Files\\R\\R-3.0.1\\bin\\x64"
[16] "C:\\Perl64\\site\\bin"
[17] "C:\\Perl64\\bin"
[18] "c:\\Rtools\\bin"
[19] "c:\\Rtools\\gcc-4.6.3\\bin"
[20] "c:\\Program Files (x86)\\AMD APP\\bin\\x86_64"
[21] "c:\\Program Files (x86)\\AMD APP\\bin\\x86"
[22] "c:\\Program Files (x86)\\Intel\\iCLS Client\\"
[23] "c:\\Program Files\\Intel\\iCLS Client\\"
[24] "C:\\Windows\\System32"
[25] "C:\\Windows"
[26] "C:\\Windows\\System32\\wbem"
[27] "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\"
[28] "c:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static"
[29] "C:\\Program Files\\Intel\\WiFi\\bin\\"
[30] "C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\"
[31] "C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86"
[32] "C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64"
[33] "C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\"
> perlpath
perl
"C:\\PROGRA~2\\MIKTEX~1.9\\miktex\\bin\\perl.exe"

It sounds like two instances of Perl clashed somehow in your PATH. Please post the output of the code below
strsplit(Sys.getenv('PATH'), ';')
Sys.which('perl')
from both LyX/knitr and plain R. (Feel free to replace anything concerning privacy such as your user name with foobar)

Related

Julia on M1: libhd5f not defined

I am encountering a bug in Julia v1.7.2.
I am trying to include a util.jl file that uses a Module.
Everything in that module works fine (I have put into a Pluto.jl notebook and everything runs).
However, when I try the following lines of code,
using Pkg
Pkg.activate(joinpath(#__DIR__, "../../dev/"))
using Module
I get this error
Activating project at `~/Desktop/dev`
ERROR: LoadError: UndefVarError: libhdf5 not defined
Stacktrace:
[1] top-level scope
# ~/.julia/packages/HDF5/pIJra/src/api_types.jl:119
[2] include(mod::Module, _path::String)
# Base ./Base.jl:418
[3] include(x::String)
# HDF5 ~/.julia/packages/HDF5/pIJra/src/HDF5.jl:1
[4] top-level scope
# ~/.julia/packages/HDF5/pIJra/src/HDF5.jl:51
[5] include
# ./Base.jl:418 [inlined]
[6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
# Base ./loading.jl:1318
[7] top-level scope
# none:1
[8] eval
# ./boot.jl:373 [inlined]
[9] eval(x::Expr)
# Base.MainInclude ./client.jl:453
[10] top-level scope
# none:1
in expression starting at /Users/me/.julia/packages/HDF5/pIJra/src/api_types.jl:119
in expression starting at /Users/me/.julia/packages/HDF5/pIJra/src/HDF5.jl:1
ERROR: LoadError: Failed to precompile HDF5 [f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f] to /Users/me/.julia/compiled/v1.7/HDF5/jl_m27neP.
Stacktrace:
[1] error(s::String)
# Base ./error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
# Base ./loading.jl:1466
[3] compilecache(pkg::Base.PkgId, path::String)
# Base ./loading.jl:1410
[4] _require(pkg::Base.PkgId)
# Base ./loading.jl:1120
[5] require(uuidkey::Base.PkgId)
# Base ./loading.jl:1013
[6] require(into::Module, mod::Symbol)
# Base ./loading.jl:997
[7] include
# ./Base.jl:418 [inlined]
[8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
# Base ./loading.jl:1318
[9] top-level scope
# none:1
[10] eval
# ./boot.jl:373 [inlined]
[11] eval(x::Expr)
# Base.MainInclude ./client.jl:453
[12] top-level scope
# none:1
in expression starting at /Users/me/Desktop/src/Module.jl:1
However, if I just try
using HDF5
I don't have any problem.
I don't understand why I can use using HDF5 just fine; I can run everything in the module just fine; but when I try to import the module, I get an error saying there is a problem with HDF5. Can anyone provide some additional insight into how Julia works that could make this problem make sense to me?
Are you running with Rosetta or the native build? If native, you should try 1.8rc3 since 1.7 has a lot of bugs with M1 native.

Julia + Centos - Arpack cannot be built

I installed julia (v1.1.1) via as stated in [platform specific instructions(https://julialang.org/downloads/platform.html) on my CentOS machine using yum and epel.
Julia works fine, but when precompiling packages (using DataFrames for example), I get
[ Info: Precompiling GLM [38e38edf-8417-5370-95a0-9cbb8c7f171a]
ERROR: LoadError: No deps.jl file could be found. Please try running Pkg.build("Arpack").
Currently, the build command might fail when Julia has been built from source
and the recommendation is to use the official binaries from julialang.org.
For more info see https://github.com/JuliaLinearAlgebra/Arpack.jl/issues/5.
I don't know enough about compilations, building from source, etc. to solve this. I guess it would work fine if I just download Julia from the main page and use it from within that folder. But I would prefer using it via package manager to automatically receive updates.
How do I solve this?
Unfortunately this is expected since Arpack.jl expects OpenBLAS to be called libopenblas64_.so.0, while in Fedora/CentOS it is libopenblasp64_.so.0. You can work around the problem using sudo ln -s /lib64/libopenblas64p_.so.0 ~/.julia/packages/Arpack/*/deps/lib/libopenblas64_.so.0. I'll try to find a solution with Arpack.jl developers.
So I eventually solved this via help of the original julialang page. For some reason, Arpack can't be built if you install julia via # yum install julia (with epel enabled). Pkg.build("Arpack") fails.
If you download julia from the official page and add it to path, it still throws the same error message. If you however start up julia and run Pkg.build("Arpack") beforehand, it works fine!
I confirm that #MilanBouchet-Valat solution works. Here is some details for Debian distribution.
I have installed Julia using Debian 4.19.37-5 package manager (synaptic for instance). I have
julia> versioninfo()
prints
Julia Version 1.0.4
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2603 v3 # 1.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
The symptoms
Under Julia I got the "expected" error when trying to install the Arpack package:
(v1.0) pkg> add Arpack
prints
Resolving package versions...
Updating `~/.julia/environments/v1.0/Project.toml`
[7d9fca2a] + Arpack v0.3.1
Updating `~/.julia/environments/v1.0/Manifest.toml`
[no changes]
then
julia> using Arpack
prints
[ Info: Precompiling Arpack [7d9fca2a-8960-54d3-9f78-7d1dccf2cb97]
ERROR: LoadError: No deps.jl file could be found. Please try running
Pkg.build("Arpack").
Currently, the build command might fail when Julia has been built from source
and the recommendation is to use the official binaries from julialang.org.
For more info see https://github.com/JuliaLinearAlgebra/Arpack.jl/issues/5.
Stacktrace:
[1] top-level scope at /home/picaud/.julia/packages/Arpack/cu5By/src/Arpack.jl:19
[2] include at ./boot.jl:317 [inlined]
[3] include_relative(::Module, ::String) at ./loading.jl:1044
[4] include(::Module, ::String) at ./sysimg.jl:29
[5] top-level scope at none:2
[6] eval at ./boot.jl:319 [inlined]
[7] eval(::Expr) at ./client.jl:393
[8] top-level scope at ./none:3
in expression starting at /home/picaud/.julia/packages/Arpack/cu5By/src/Arpack.jl:16
ERROR: Failed to precompile Arpack [7d9fca2a-8960-54d3-9f78-7d1dccf2cb97] to /home/picaud/.julia/compiled/v1.0/Arpack/X5VZL.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
however
pkg> build Arpack
prints
Building Arpack → `~/.julia/packages/Arpack/cu5By/deps/build.log`
┌ Error: Error building `Arpack`:
│ ERROR: LoadError: LibraryProduct(nothing, ["libarpack"], :libarpack, "Prefix(/home/picaud/.julia/packages/Arpack/cu5By/deps/usr)") is not satisfied, cannot generate deps.jl!
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] #write_deps_file#152(::Bool, ::Function, ::String, ::Array{LibraryProduct,1}) at /home/picaud/.julia/packages/BinaryProvider/TcAwt/src/Products.jl:414
│ [3] (::getfield(BinaryProvider, Symbol("#kw##write_deps_file")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(write_deps_file), ::String, ::Array{LibraryProduct,1}) at ./none:0
│ [4] top-level scope at none:0
│ [5] include at ./boot.jl:317 [inlined]
│ [6] include_relative(::Module, ::String) at ./loading.jl:1044
│ [7] include(::Module, ::String) at ./sysimg.jl:29
│ [8] include(::String) at ./client.jl:392
│ [9] top-level scope at none:0
│ in expression starting at /home/picaud/.julia/packages/Arpack/cu5By/deps/build.jl:74
└ # Pkg.Operations /build/julia-gbfU8y/julia-1.0.4+dfsg/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096
The diagnostic
You can check that this is a dependance problem with:
ldd ~/.julia/packages/Arpack/cu5By/deps/usr/lib/libarpack.so
prints
linux-vdso.so.1 (0x00007ffc179a1000)
libopenblas64_.so.0 => not found <----
libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007feea073d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007feea05ba000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007feea05a0000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007feea0557000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feea0396000)
/lib64/ld-linux-x86-64.so.2 (0x00007feea0c67000)
Debian distro:
find /usr/lib/ -name libopenblas\*
prints
/usr/lib/x86_64-linux-gnu/libopenblas.so
/usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.6.a
/usr/lib/x86_64-linux-gnu/libopenblas64_.so.0
/usr/lib/x86_64-linux-gnu/julia/libopenblas.so
/usr/lib/x86_64-linux-gnu/libopenblas.so.0
/usr/lib/x86_64-linux-gnu/libopenblas.a
/usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.6.so
The "fix"
With root privileges (su) create a symbolic links
ln -s /usr/lib/x86_64-linux-gnu/libopenblas.so /usr/lib/x86_64-linux-gnu/libopenblas64_.so.0
Now it works
pkg> build Arpack
Building Arpack → `~/.julia/packages/Arpack/cu5By/deps/build.log`
then
using Arpack
[ Info: Precompiling Arpack [7d9fca2a-8960-54d3-9f78-7d1dccf2cb97]
are OK

How to include a file from a different directory in Julia 0.7?

While learning Julia, I've stumbled on a basic task of including files from a different directory. I have two directories, Core and Explore, neither of which is the parent of the other; see the figure. Directory Core has a file Core.jl with
module Core
foo() = 1
end
or it could be a basic .jl file, not a module, with foo().
The file Explore.jl, in directory Explore, needs to use foo() from Core.jl. So I tried putting the following lines into Explore.jl: /Users/me/PycharmProjects/juliaProjects/src/Core/Core.jl, include("./Core.jl") and other permutations. However I keep getting errors like
ERROR: LoadError: could not open file /Users/me/PycharmProjects/juliaProjects/src/Core/Core.jl
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1038
[3] include(::Module, ::String) at ./sysimg.jl:29
[4] include(::String) at ./client.jl:398
[5] top-level scope at none:0
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1038
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] exec_options(::Base.JLOptions) at ./client.jl:239
[10] _start() at ./client.jl:432
in expression starting at /Users
Question: What would be a correct include specification to put into a jl. file?
The environment is Julia 0.7 on Mac OS High Sierra. Note that I'm not using a shell, but an IDE, namely, the julia plug-in 0.3.3 for Intellij 2018.3.
I've checked other questions on SO, eg loading a module from the local directory in Julia, How to import custom module in julia, What should path be to Julia source file?, but they didn't seem to work.
Edit: Based on the accepted answer, the file Explore.jl should include
cd("src/Core")
include("../Core/Core.jl")
You cannot name a module Core because it is a reserved name and (have tested on my computer) creating such module crashes Julia in unexpected way.
Please see the example julia session below to understand how to create and load a module located in a different folder (please not that changing from julia> to shell> prompt is acquired by pressing ; and exiting shell> is with backspace):
shell> mkdir mymod
shell> vim mymod/mod.jl
shell> more mymod/mod.jl
module MyMod
foo() = 1
end
shell> mkdir dir2
julia> cd("dir2")
julia> include("../mymod/mod.jl")
Main.MyMod
julia> using Main.MyMod
julia> MyMod.foo()
1

cpan install fails with "'.' is not recognized as an internal or external command"

I am using Strawberry Perl 64-bit on Windows (5.26.2.1). Some CPAN modules install correctly, such as Log::Log4perl. However a lot of different modules are failing install with the same error: '.' is not recognized as an internal or external command.
I'm not really sure what to do about this. My best guess is that maybe these modules don't work with Windows, but that's just a guess. An example is Text::Trim which doesn't have any message in its docs that it wouldn't work on Windows.
If you know how to make CPAN install messages more verbose, that might also help track this down. Here is the error:
cpan[6]> install Text::Trim
install Text::Trim
Running install for module 'Text::Trim'
Checksum for C:\Users\me\.cpan\sources\authors\id\M\MA\MATTLAW\Text-Trim-1.02.tar.gz ok
Configuring M/MA/MATTLAW/Text-Trim-1.02.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Text-Trim' version '1.02'
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe Build.PL installdirs=site -- OK
Running Build for M/MA/MATTLAW/Text-Trim-1.02.tar.gz
Building Text-Trim
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe ./Build -- OK
Running Build test
t\01..trim.t ..... ok
t\02..ltrim.t .... ok
t\03..rtrim.t .... ok
t\04..unicode.t .. ok
t\05..undef.t .... ok
t\99..pod.t ...... ok
All tests successful.
Files=6, Tests=63, 2 wallclock secs ( 0.05 usr + 0.70 sys = 0.75 CPU)
Result: PASS
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe ./Build test -- OK
Running Build install
'.' is not recognized as an internal or external command,
operable program or batch file.
MATTLAW/Text-Trim-1.02.tar.gz
./Build install -- NOT OK
Failed during this command:
MATTLAW/Text-Trim-1.02.tar.gz : install NO
Note that I also have Berrybrew installed, so I was also thinking they could interfere with each other, but the fact that Log::Log4perl works makes me think it's relatively unlikely.
EDIT: Strangely, installing Text::Trim using cpanm worked...
EDIT: Per request in the comments, here is the output from o conf from the cpan command prompt below. Note however that the cpan this is running is at C:\berrybrew\5.26.1_64\perl\bin\cpan.bat so it's strange that it's picking up other versions of certain things from C:\Strawberry\c\bin.
cpan[2]> o conf
$CPAN::Config options from C:\Users\me\.cpan/CPAN/MyConfig.pm:
commit [Commit changes to disk]
defaults [Reload defaults from disk]
help [Short help about 'o conf' usage]
init [Interactive setting of all options]
applypatch []
auto_commit [0]
build_cache [100]
build_dir [C:\Users\me\.cpan\build]
build_dir_reuse [0]
build_requires_install_policy [yes]
bzip2 [/mingw64/bin/bzip2]
cache_metadata [1]
check_sigs [0]
cleanup_after_install undef
colorize_debug undef
colorize_output [0]
colorize_print undef
colorize_warn undef
commandnumber_in_prompt [1]
commands_quote undef
connect_to_internet_ok [1]
cpan_home [C:\Users\me\.cpan]
curl [C:\Users\me\AppData\Local\Continuum\Anaconda3\Library\bin\curl.EXE]
dontload_hash undef
dontload_list undef
ftp undef
ftp_passive [1]
ftp_proxy []
ftpstats_period undef
ftpstats_size undef
getcwd [cwd]
gpg [/usr/bin/gpg]
gzip [/usr/bin/gzip]
halt_on_failure [0]
histfile [C:\Users\me\.cpan\histfile]
histsize [100]
http_proxy []
inactivity_timeout [0]
index_expire [1]
inhibit_startup_message [0]
keep_source_where [C:\Users\me\.cpan\sources]
load_module_verbosity [none]
lynx undef
make [C:\Strawberry\c\bin\gmake.EXE]
make_arg []
make_install_arg []
make_install_make_command [C:\Strawberry\c\bin\gmake.EXE]
makepl_arg [INSTALLDIRS=site]
mbuild_arg []
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg [installdirs=site]
ncftp undef
ncftpget undef
no_proxy []
pager [C:\windows\system32\more.COM]
password undef
patch [C:\Strawberry\c\bin\patch.EXE]
patches_dir undef
perl5lib_verbosity [none]
plugin_list
prefer_external_tar [0]
prefer_installer [MB]
prefs_dir [C:\Users\me\.cpan\prefs]
prerequisites_policy [follow]
proxy_pass undef
proxy_user undef
randomize_urllist undef
recommends_policy [1]
scan_cache [atstart]
shell [C:\windows\system32\cmd.exe]
show_unparsable_versions [0]
show_upload_date [0]
show_zero_versions [0]
suggests_policy [0]
tar [/usr/bin/tar]
tar_verbosity [none]
term_is_latin [1]
term_ornaments [1]
test_report [0]
trust_test_report_history [0]
unzip [/usr/bin/unzip]
urllist
0 [http://www.cpan.org/]
use_prompt_default [0]
use_sqlite [0]
username undef
version_timeout [15]
wait_list undef
wget []
yaml_load_code [0]
yaml_module [YAML]

Cannot start GlassFish in Eclipse: GlassFish error : Could not find or load main class files

I am attempting to start glassfish from within eclipse (juno). I get the following error:
INFO: Successfully launched in 10 msec.
Error: Could not find or load main class Files
Command start-domain failed.
The DAS was stopped.
Here is the complete output in Eclipse:
Aug 16, 2012 11:51:23 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
C:\Program Files\Java\jdk1.7.0\bin\java.exe
-cp
C:/glassfish3-2/glassfish3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-javaagent:C:/glassfish3-2/glassfish3/glassfish/lib/monitor/btrace- agent.jar=unsafe=true,noServer=true
-client
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.disableConfigSave=false
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\glassfish3-2\glassfish3\glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=C:\glassfish3-2\glassfish3\glassfish\domains\domain1
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serv erbeans.AppserverConfigEnvironmentFactory
-Djava.endorsed.dirs=C:\glassfish3-2\glassfish3\glassfish/modules/endorsed; C:\glassfish3-2\glassfish3\glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=C:\glassfish3-2\glassfish3\glassfish
-Dfelix.fileinstall.bundles.startTransient=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0/lib/ext;C:\Program Files\Java\jdk1.7.0/jre/lib/ext;C:\glassfish3-2\glassfish3\glassfish\domains\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/cacerts.jks
Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.security.auth.login.config=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/login.conf
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dgosh.args=--nointeractive
-Djava.library.path=C:/glassfish3-2/glassfish3/glassfish/lib;C:/Program Files/Java/jdk1.7.0/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/Program Files (x86)/HP SimplePass 2011/x64;C:/Program Files (x86)/HP SimplePass 2011;C:/Program Files/Common Files/Microsoft Shared/Windows Live;C:/Program Files (x86)/Common Files/microsoft shared/Windows Live;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Program Files (x86)/Windows Live/Shared;C:/Program Files/Intel/WiFi/bin;C:/Program Files/Common Files/Intel/WirelessCommon;C:/Program Files (x86)/Intel/Services/IPT;C:/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn;C:/Program Files/Microsoft SQL Server/100/Tools/Binn;C:/Program Files/Microsoft SQL Server/100/DTS/Binn;C:/Program Files (x86)/Microsoft ASP.NET/ASP.NET Web Pages/v1.0;C:/Program Files (x86)/Java/jdk1.7.0_01/bin;C:/glassfish3-2/glassfish3/glassfish/"C:/eclipse/eclipse.exe;C:/glassfish3-2/glassfish3/glassfish/" -vm "C:/Program Files (x86)/Java/jdk1.7.0_01/jre/bin/javaw.exe;C:/glassfish3-2/glassfish3/glassfish/.;C:/Program Files/Microsoft SQL Server/110/Tools/Binn;C:/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn;C:/Program Files/Microsoft SQL Server/110/DTS/Binn;C:/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn/ManagementStudio;C:/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn;C:/Program Files/jEdit;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/QuickTime/QTSystem;C:/Program Files/Java/jdk1.7.0/db/bin;C:/glassfish3-2/glassfish3/glassfish
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=false,,,start-domain,,,--verbose=true,,,--debug=false,,,--domaindir,,,C:\glassfish3-2\glassfish3\glassfish\domains,,,domain1
-instancename
server
-verbose
true
-debug
false
-asadmin-classpath
C:/glassfish3-2/glassfish3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-type
DAS
-domaindir
C:/glassfish3-2/glassfish3/glassfish/domains/domain1
-read-stdin
true
Aug 16, 2012 11:51:23 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 10 msec.
Error: Could not find or load main class Files
Command start-domain failed.
The DAS was stopped.
Thanks as always in advance.
Regards,
umbregachoong
This happened to me with glassfish started on command prompt.
c:\glassfish4\glassfish\bin>asadmin start-domain
Waiting for domain1 to start .
Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Error: Could not find or load main class Files
Command start-domain failed.
It was caused by having the following on PATH:
Path=...;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;...
I had the same issue as jan.supol, setting the path of the NVIDIA binaries into double-quotes like this also fixed it for me:
Path=...;"C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common";...
Most probably this can be caused by any whitespace in the PATH-variable that is not enclosed in double-quotes.