JVM 7 fails to start

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
bobul
Newbie
Newbie
Posts: 4
Joined: Wed Dec 28, 2011 7:32 am

JVM 7 fails to start

Post by bobul »

Hi,

I installed the jre-7u2 into the wine under Ubuntu 11.10

But, when I try to run the java itself:

Code: Select all

wine ${PATH_TO_JAVA/BIN}/java.exe
I get following error:

Code: Select all

fixme:heap:HeapSetInformation (nil) 1 (nil) 0
Error occurred during initialization of VM
java/io/IOException: Bad pathname
Any hints? Help will be mostly appreciated, I need to run windows app, which uses JVM.

Thanks.
Martin Gregorie

JVM 7 fails to start

Post by Martin Gregorie »

On Wed, 2011-12-28 at 07:02 -0600, bobul wrote:
Hi,

I installed the jre-7u2 into the wine under Ubuntu 11.10

But, when I try to run the java itself:


Code:
wine ${PATH_TO_JAVA/BIN}/java.exe
This should work better:

cd ${PATH_TO_JAVA}/BIN
wine java.exe

because a shell variable name can't contain '/'. However, if your
program is pure Java, i.e. doesn't use Windows code run via JNI and so
doesn't break the WORA[1] contract, why aren't you running it under a
native Linux JVM?

[1] WORA = "Write Once, Run Anywhere" which states that any program
written in Java without using OS-specific code extensions will run
correctly in any certified JVM on any supported operating system.


Martin
bobul
Newbie
Newbie
Posts: 4
Joined: Wed Dec 28, 2011 7:32 am

Post by bobul »

Thank you Martin, you were right. Now the java.exe is working properly and that might be the problem with my app.

As I said - the application is not pure Java, it just uses JVM, it is not open-source, it is commercial application and it also uses some DLLs.

So now my problem is with the application, that it cannot find the jre when starting(it is started by .exe file) - the jre is located in one subfolder but it still cannot be found :-\
Martin Gregorie

JVM 7 fails to start

Post by Martin Gregorie »

On Thu, 2011-12-29 at 18:11 -0600, bobul wrote:
As I said - the application is not pure Java, it just uses JVM, it is
not open-source, it is commercial application and it also uses some
DLLs.
Gaaah! Another bunch of developers who don't understand the meaning of
WORA.
So now my problem is with the application, that it cannot find the jre
when starting(it is started by .exe file) - the jre is located in one
subfolder but it still cannot be found :-\
How does the app know where Java is installed (in a .INI file, the
registry, hard-coded into the program or what)?

If it can be configured, do so, by changing the config file or registry
with the appropriate editor. Be sure to use Wine's version of regedit if
its in the registry. If its not configurable, try running the program
from the console, look through the console output to see where the
program expects to find the JRE, and then put it where the program is
looking.


Martin
bobul
Newbie
Newbie
Posts: 4
Joined: Wed Dec 28, 2011 7:32 am

Re: JVM 7 fails to start

Post by bobul »

Martin Gregorie wrote:On Thu, 2011-12-29 at 18:11 -0600, bobul wrote:
As I said - the application is not pure Java, it just uses JVM, it is
not open-source, it is commercial application and it also uses some
DLLs.
Gaaah! Another bunch of developers who don't understand the meaning of
WORA.
my words... :)
So now my problem is with the application, that it cannot find the jre
when starting(it is started by .exe file) - the jre is located in one
subfolder but it still cannot be found :-\
How does the app know where Java is installed (in a .INI file, the
registry, hard-coded into the program or what)?
[/quote]

You're right, there is a config file, which states the relative path to the jre the app uses (it brings it's own version with it) - looks like

Code: Select all

<launcherConfig>
  <jvmParams
    jvmPath="./jre"
	jars="./lib"
	userConfigPath=""
	jvmOptions="-Xmx512m;-XX:PermSize=64m;-XX:MaxPermSize=160m;-XX:+DisableExplicitGC;-Dsun.java2d.d3d=false"
	AutomaticMemoryManagement="true" />
</launcherConfig>
So, could there be a problem with a relative path to JVM?
If it can be configured, do so, by changing the config file or registry
with the appropriate editor. Be sure to use Wine's version of regedit if
its in the registry. If its not configurable, try running the program
from the console, look through the console output to see where the
program expects to find the JRE, and then put it where the program is
looking.


Martin
Tried to run it from the cmd, did not get any additional info :-|
Martin Gregorie

JVM 7 fails to start

Post by Martin Gregorie »

On Fri, 2011-12-30 at 04:55 -0600, bobul wrote:
So now my problem is with the application, that it cannot find the jre
when starting(it is started by .exe file) - the jre is located in one
subfolder but it still cannot be found :-\

How does the app know where Java is installed (in a .INI file, the
registry, hard-coded into the program or what)?
You're right, there is a config file, which states the relative path to the jre the app uses (it brings it's own version with it) - looks like

Code:
<launcherConfig>
<jvmParams
jvmPath="./jre"
jars="./lib"
userConfigPath=""
jvmOptions="-Xmx512m;-XX:PermSize=64m;-XX:MaxPermSize=160m;-XX:+DisableExplicitGC;-Dsun.java2d.d3d=false"
AutomaticMemoryManagement="true" />
</launcherConfig>



So, could there be a problem with a relative path to JVM?

[/quote]This looks like you have tripped over a difference between the way
programs are written for Windows and Linux: a Linux program expects the
current directory to be the one containing the data and that it will be
loaded and run by searching $PATH for the executable while Windows
programs expect that the current directory contains themselves and that
they will be passed an absolute or relative path to the data they are
expected to use. This means that almost all Windows apps must be run
like this:

cd $WINEPREFIX/path/to/directory/holding/the/executable
wine theapp.exe

In your case NOT doing this means that .jre and .lib will treated as
relative to the directory you issued the command in, probably $HOME, and
so the the program won't be able to find them. Doing the initial 'cd'
makes the current directory the one containing the program, so .jre
and .lib will be relative to the program's location and hence they will
point to where the program expects them to point.

It rather looks as though you didn't do that. So, try it. If it doesn't
work, post the result of running
ls -l . ./jre ./lib

in the directory containing the exe that wine starts. If there's much in
those directories, i.e. there's more than 30 lines or so of output,
please put it in pastebin, the temporary storage website, and post a
link here.


Martin
bobul
Newbie
Newbie
Posts: 4
Joined: Wed Dec 28, 2011 7:32 am

Re: JVM 7 fails to start

Post by bobul »

Martin Gregorie wrote:On Fri, 2011-12-30 at 04:55 -0600, bobul wrote:
This looks like you have tripped over a difference between the way
programs are written for Windows and Linux: a Linux program expects the
current directory to be the one containing the data and that it will be
loaded and run by searching $PATH for the executable while Windows
programs expect that the current directory contains themselves and that
they will be passed an absolute or relative path to the data they are
expected to use. This means that almost all Windows apps must be run
like this:

cd $WINEPREFIX/path/to/directory/holding/the/executable
wine theapp.exe

In your case NOT doing this means that .jre and .lib will treated as
relative to the directory you issued the command in, probably $HOME, and
so the the program won't be able to find them. Doing the initial 'cd'
makes the current directory the one containing the program, so .jre
and .lib will be relative to the program's location and hence they will
point to where the program expects them to point.

It rather looks as though you didn't do that. So, try it. If it doesn't
work, post the result of running
ls -l . ./jre ./lib

in the directory containing the exe that wine starts. If there's much in
those directories, i.e. there's more than 30 lines or so of output,
please put it in pastebin, the temporary storage website, and post a
link here.


Martin
Hi I am running the .exe file from the directory, where it is located.

Result of running the ls -l is here: http://pastebin.com/Bi68VAMN
i.e. I think the JRE is there allright. It runs OK on windows.
Maybe I can try to use the absolute path in the config file.

But there is a question - what is the root folder for application run within wine? (is it / or my home folder? or it is c:\?)

Jan
Martin Gregorie

JVM 7 fails to start

Post by Martin Gregorie »

On Mon, 2012-01-02 at 06:45 -0600, bobul wrote:
Hi I am running the .exe file from the directory, where it is located.

Result of running the ls -l is here: http://pastebin.com/Bi68VAMN
i.e. I think the JRE is there allright. It runs OK on windows.
Maybe I can try to use the absolute path in the config file.

But there is a question - what is the root folder for application run
within wine? (is it / or my home folder? or it is c:\?)
The current working directory is the directory you were in when you
issued the 'wine' command. As far as the app is concerned that will be
its current working directory as well, so jre and lib should be relative
to that. AFAIK absolute paths will always be relative to the 'drive
letter' symlinks in $WINEPREFIX/dosdevices: the C: symlink points to
$WINEPREFIX/drive_c, so that's the root of the default drive.


Martin
Locked