FATAL ERROR - can't find Java Virtual Machine on 7.0

Having trouble installing Oxygen? Got a bug to report? Post it all here.
cberrymd
Posts: 7
Joined: Wed Jan 18, 2006 12:53 am
Contact:

FATAL ERROR - can't find Java Virtual Machine on 7.0

Post by cberrymd »

I'm running Redhat EL4 and have been using <oXygen/> 6.x without problems. Updated to 7.0 and I get:
"FATAL ERROR
<oXygen/> requires a Java Virtual Machine..."
My java version is 1.4.2 which shouldn't be too old. What gives?

What's really weird is that this is not a very fatal FATAL ERROR since if I ignore it and click "continue" things seem to work fine.

Anybody know how to fix this?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

If you change directory to the <oXygen/> install directory in a console and run:

Code: Select all

sh oxygen.sh
does <oXygen/> start without any error message ?

Regards,
Sorin
cberrymd
Posts: 7
Joined: Wed Jan 18, 2006 12:53 am
Contact:

Post by cberrymd »

No. That is when I get the error message. After I ignore it <oXygen/> starts, but I don't expect that the JRE scripts will run properly.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

The complete message is:

<oXygen/> requires a Java Virtual Machine from Sun Microsystems Inc.
Please either get the oXygen distribution that includes a JVM (if available for
your platform) or download a Java Runtime Environment (JRE) from Sun Microsystems Inc.:
http://java.sun.com/


So it means that you run oXygen with a JRE that is not from Sun and it is not supported. It may run without problems but you also may hit somtimes strange behaviour with that. It is recommended to use a JVM from Sun.

Best Regards,
George
cberrymd
Posts: 7
Joined: Wed Jan 18, 2006 12:53 am
Contact:

Post by cberrymd »

I have both ibm and Sun. How can I tell <oXygen/> where to find the Sun version it wants?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

If you launch <oXygen/> from the shortcut created by the installer wizard you have to add a line like this:

Code: Select all

export app_java_home=/home/sorin/jdk1.5.0_05
in the oxygen7.0 startup script created by the installer, just before the line at the end of the script which begins with:

Code: Select all

"$app_java_home/bin/java" -client -Dinstall4j.jvmDir="$app_java_home" -Dinstall4j.appDir="$app_home"
Of course you have to use the path to the Sun JVM home dir installed on your machine instead of /home/sorin/jdk1.5.0_05.

If you launch <oXygen/> using the oxygen.sh script located in the <oXygen/> home dir with a command

Code: Select all

sh oxygen.sh
you have to launch explicitly the Sun JVM by specifying the full path to the java executable in the last line of the script, something like:

Code: Select all

/home/sorin/jdk1.5.0_05/bin/java -Xmx256m "-Dcom.oxygenxml.editor.plugins.dir=$p/plugins" ...
or to make sure the bin subdirectory of the Sun JVM home directory is specified in the PATH environment variable before directories containing the executable of other JVMs.

Regards,
Sorin
cberrymd
Posts: 7
Joined: Wed Jan 18, 2006 12:53 am
Contact:

Post by cberrymd »

That fixed it. Thanks!
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Ran into the same problem on Windows when using the exe

Post by sanderson »

When I use the exe on Windows I occassionaly get the same errror. Using the batch file I never see the error.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

A Java virtual machine not from Sun Microsystems is found in the Windows registry before a Sun JVM. Using the Windows installation kit which includes a JVM will ensure that <oXygen/> runs inside a Sun Microsystems JVM and that JVM will not interfere with any other applications on your machine. If you installed already the kit without JVM you have to set the home dir of a Sun JVM in the .ini file of the <oXygen/> executable as explained in the second note on this page.

Regards,
Sorin
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Post by sanderson »

Sorry, I'm actually getting a different error. My error is:
JNI exception: failed to create the Java VM.
In my oxygen7.0.ini I have the following

Code: Select all


JRE Path=c:\dev\tools\win32\jdk\jdk1.5.0_02\jre
and I still get the same error.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

It seems the oxygen.bat script runs other Java virtual machine. Do you get any error if you edit the line which starts the Java virtual machine in the oxygen.bat script like this:

Code: Select all

c:\dev\tools\win32\jdk\jdk1.5.0_02\jre\bin\java -Xmx256m  -cp %CP% ro.sync.exml.Oxygen %1 %2 %3 %4 %5 %6 %7
and start up <oXygen/> using this script ?

Regards,
Sorin
sanderson
Posts: 51
Joined: Fri Jan 27, 2006 12:51 am

Post by sanderson »

The batch file never throws and error, only the executable.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello sanderson,
sanderson wrote:When I use the exe on Windows I occassionaly get the same errror. Using the batch file I never see the error.
sanderson wrote:My error is:
JNI exception: failed to create the Java VM.
In my oxygen7.0.ini I have the following

Code: Select all


JRE Path=c:\dev\tools\win32\jdk\jdk1.5.0_02\jre
sorin wrote:Do you get any error if you edit the line which starts the Java virtual machine in the oxygen.bat script like this:

Code: Select all

c:\dev\tools\win32\jdk\jdk1.5.0_02\jre\bin\java -Xmx256m  -cp %CP% ro.sync.exml.Oxygen %1 %2 %3 %4 %5 %6 %7
and start up <oXygen/> using this script ?
sanderson wrote:The batch file never throws and error, only the executable.
If oxygen.bat gives no error with c:\dev\tools\win32\jdk\jdk1.5.0_02\jre\bin\java then oxygen.exe should also give no error with JRE Path=c:\dev\tools\win32\jdk\jdk1.5.0_02\jre in oxygen.ini because it is the same Java virtual machine. The .exe is just a wrapper which starts up the Java virtual machine. Please post all the content of your oxygen7.0.ini file.

Regards,
Sorin
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

Error starting OxygenXML

Post by netman »

sorin wrote:If oxygen.bat gives no error with c:\dev\tools\win32\jdk\jdk1.5.0_02\jre\bin\java then oxygen.exe should also give no error with JRE Path=c:\dev\tools\win32\jdk\jdk1.5.0_02\jre in oxygen.ini because it is the same Java virtual machine. The .exe is just a wrapper which starts up the Java virtual machine. Please post all the content of your oxygen7.0.ini file.

Regards,
Sorin
Hello. I have the same problem. When I start OxygenXML by exe file it gives me

Code: Select all

JNI exception: failed to create the JavaVM
error.

Code: Select all

[Display]
Splash Screen=C:\Program Files (x86)\Authoring\Oxygen 7.1\SplashScreen.bmp
[Java Runtime Environment]
JVM Type=favor_client
Virtual Machine Parameters=-Xmx40P -Dcom.oxygenxml.splash=false
Preferred versions=1.5;
Minimum Version=1.4.2
Main Class=ro.sync.exml.Oxygen
Maximum Version=any
JRE Path=C:\Program Files (x86)\Java\jre1.5.0_04
[Application]
Application Type=gui
Single Instance=yes
[Class Path]
Class Path=C:\Program Files (x86)\Authoring\Oxygen 7.1\lib\oxygen.jar;
whether I put JRE Path variable in ini-file or not

But oxygenxml.bat starts oxygen perfectly. What shoudl I do?

Code: Select all

C:\Program Files (x86)\Oxygen 7.1>rem C:\Program Files (x86)\Oxygen 7.1\ is expanded pathname of the current script under NT

C:\Program Files (x86)\Oxygen 7.1>SET CP="C:\Program Files (x86)\Oxygen 7.1\;C:\Program Files (x86)\Oxygen 7.1\/lib/oxygen.jar;C:\Program Files (x86)\Oxygen 7.1\/classes;"

C:\Program Files (x86)\Oxygen 7.1>java -Xmx256m -cp "C:\Program Files (x86)\Oxygen 7.1\;C:\Program Files (x86)\Oxygen 7.1\/lib/oxygen.jar;C:\Program Files (x86)\Oxygen 7.1\/classes;" ro.sync.exml.Oxygen
Time 3218
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,
sanderson wrote:The batch file never throws and error, only the executable.
netman wrote:But oxygenxml.bat starts oxygen perfectly. What shoudl I do?
First we need to identify the problem. Unzip this archive in the <oXygen/> install folder, C:\Program Files (x86)\Oxygen 7.1\ on your computer, and try to start <oXygen/> by double-clicking on each of the .exe files contained in the archive. Post here the effect of each one (<oXygen/> starts up normally, the same error message about the JNI exception, a different error message, etc). You will have to use the correct JRE path for your JRE installation in each .ini file corresponding to the .exe files. In your case that means replacing the line

Code: Select all

JRE Path=C:\Program Files\Java\jre1.5.0_06
with the line

Code: Select all

JRE Path=C:\Program Files (x86)\Java\jre1.5.0_04
in each .ini file before double-clicking on the corresponding .exe file. Other users obtaining the same JNI exception message are welcome to post their result here.

Regards,
Sorin
Last edited by sorin_ristache on Mon Apr 10, 2006 2:26 pm, edited 2 times in total.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,
sanderson wrote:The batch file never throws and error, only the executable.
First we need to identify the problem. Unzip this archive in the <oXygen/> install folder, C:\Program Files (x86)\Oxygen 7.1\ on your computer, and try to start <oXygen/> by double-clicking on each of the .exe files contained in the archive. Post here the effect of each one (<oXygen/> starts up normally, the same error message about the JNI exception, a different error message, etc). You will have to use the correct JRE path for your JRE installation in each .ini file corresponding to the .exe files. In your case that means replacing the line

Code: Select all

JRE Path=C:\Program Files\Java\jre1.5.0_06
with the line

Code: Select all

JRE Path=C:\Program Files (x86)\Java\jre1.5.0_04
in each .ini file before double-clicking on the corresponding .exe file. Other users obtaining the same JNI exception message are welcome to post their result here.

Regards,
Sorin
Last edited by sorin_ristache on Tue Apr 11, 2006 9:18 am, edited 1 time in total.
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

The same error

Post by netman »

Every time error is the same error message about the JNI exception.

Could this possibly help http://www.mytempdir.com/583909 ?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

Thank you for the file. The problem is the maximum memory limit set for the Java virtual machine at startup which is too high on your machine. Please change the parameter -Xmx40P on the line Virtual Machine Parameters of the file [oXygen-install-folder]/oxygen7.1.ini to -Xmx1024m. That means 1 GB reserved for the heap space of the JVM and should be more than enough even for processing large documents in <oXygen/>. Then restart <oXygen/>. Anyway the launcher of version 7.2 will address this problem so that the JNI exception will not occur at startup.

Regards,
Sorin
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

Post by netman »

Thanks, sorin now it works. But somehow _weird_, it start 1 in 2-5 times. It rest it's the same JNI exception error. Strange
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

It is possible that the maximum heap limit is not the only problem on your computer. Please try with -Xmx512m and if you still get the JNI exception sometimes at startup it would be really helpful if you can close <oXygen/> and start up again but by double clicking on OxygenMod0.exe which was included in the zip archive instead of oxygen7.1.exe which is launched by the Start menu shortcut.

Regards,
Sorin
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

Post by netman »

When I put Xmx512M it starts fine without errors and when I leave Xmx1024M even by double clicking on OxygenMod0.exe it gives the same JNI error
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

Delete the file OxygenMod0.log, leave -Xmx1024m in OxygenMod0.ini and double click again on OxygenMod0.exe. After that please send the generated OxygenMod0.log file to support at oxygenxml dot com. How much RAM memory do you have on the computer ?

Regards,
Sorin
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

Post by netman »

Here it is http://www.mytempdir.com/611815
I have 3Gb
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

We will contact again the company which develops the Windows installer application in order to fix the problem and we will send the log file. Until then please use a lower value, for example -Xmx512m or -Xmx800m.

Thank you,
Sorin
netman
Posts: 6
Joined: Mon Apr 10, 2006 12:43 pm

Post by netman »

Certanly. No problem. Just wanted to make your app better
Post Reply