• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse is running in a JRE, but a JDK is required

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set up maven with eclipse when I ran eclipse I got the following error

Eclipse is running in a JRE, but a JDK is required

in my eclipse.ini I have the following setup

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-vm
C:\JavaJDK\Java\jdk1.6.0_01\bin\javaw.exe
-Xms40m
-Xmx512m

which as we all know will be ignored, you dont expect to solve a IT problem just by following instructions.

So I tried starting eclipse wih the -v option from the command line an go the following.

C:\eclipse>eclipse -vm C:\JavaJDK\Java\jdk1.6.0_01\bin\javaw.exe

Could not create the Java Virtual Machine


C:\eclipse>eclipse -vm C:\JavaJDK\Java\jdk1.6.0_01\bin\javaw.exe -Xms40m -Xmx512m

Could not create the Java Virtual Machine

Edited the eclipse start up properties file got the same error Could not create the Java Virtual Machine.

Would welcome any help as I have a sore head from banging it against the wall.

Cheers Tony

 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also how do you get around the windows program file problem, all JDKS are stored there but eclipse does not like spaces. so C:\Program file\java is seen as C:\Program.

It also does not like "C:\Program file\java".

Thanks for any help.

Tony

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony Evans wrote:Also how do you get around the windows program file problem, all JDKS are stored there but eclipse does not like spaces. so C:\Program file\java is seen as C:\Program.

It also does not like "C:\Program file\java".



It's always recommended not to install Java (or any Java related utilities) in a folder containing a space in its path. It's better to move the Java installation outside the Program Files and then set the JAVA_HOME appropriately to point to the new path. For example, I have JDK 5 at C:/Java/jdk1.5.0

 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaikiran Pai I agree why sun wont allow you to se the path I dont know. Thats not the problem the main problem is trying to get eclipse running with a maven plugin.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the log file. I don't have any issues using a quoted path, but YMMV. If you specify -Xmx/-Xms on the command line you must still use the -vmargs option, as far as I know.
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply David, I agree that I dont need to use maven within my eclipse the problem is then that without the maven plug in.

The code looks very messey with lots of errors highlighted which hides the real errors.

I am building a Sping webservice my POM file contains the paths, but without the maven plugin eclipse can not see the jar files.

Its either mot use maven an import them then build with ant.
Or use the POM file but not use the IDE for running even for debugging.

Or try to solve the

error Could not create the Java Virtual Machine or the error Eclipse is running in a JRE, but a JDK is required if I dont add the eclipse -vm C:\JavaJDK\Java\jdk1.6.0_01\bin\javaw.exe .

Have you manged to install the maven plugin, and manged to get eclipse running.

Cheers Tony
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Maven plugin (or set libs manually, if you're dead-set on using the plugin) and still do lifecycle stuff on the command line. Without having your machine in front of me it's going to be difficult to debug your setup: I have no issues running Eclipse, specifying the VM, in either the config file or from the command line. Maybe check the execute VM settings once you're inside Eclipse (I forget how, maybe under About).

Yes, I've installed the Maven plugin and can use it w/o any (unknown) issues.
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved thanks to java ranch on anoher thread here is he correct setting in the eclipse.ini file

-vm
C:\JavaJDK\Java\jdk1.6.0_01\jre\bin\client\jvm.dll

Here is the ini file in full;

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:\JavaJDK\Java\jdk1.6.0_01\jre\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Weird; I just use javaw.
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,

I guess it might be what version of eclipse, java, maven, an what OS an is it a 32 or 64 bit machine. wih so much sofware flying about so many versions an so much refactoring of existing functionality, you can never be sure that what worked one day will work anoher day if you update a version.

To many variables. The fun of trying something new.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The key is that the -vm entry must come before the -vmargs entry. And the path to the JVM can be to java.exe, javaw.exe or jvm.dll. In either case what Eclipse is really looking for is the jvm.dll (or jvm.so on Linux) so that it can load it. I just point Eclipse directly to the jvm.dll.
 
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....


The answer is that you have to have a line break between

-vm

and the path.

So in the eclipse.ini file:

THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:
-vm
C:\java\jdk\bin\javaw.exe
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, each token in eclipse.ini must be on its own line.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeremy Goodell wrote:Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....
The answer is that you have to have a line break between

-vm

and the path.

So in the eclipse.ini file:

THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:
-vm
C:\java\jdk\bin\javaw.exe



Thanks a Lot....

The trick saved my time..

 
Greenhorn
Posts: 1
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I encountered this same problem, and the suggestions here helped me solve it, but I want to point out a couple differences from what the others here experienced.

First, I have no problems with my JDK being installed in a path with a space in it ("C:/Program Files/Java/jdk1.6.0_22"). I have been doing this for years without issue.

Second, the crucial elements to get the "-vm" configuration to work were that I had to NOT put the path in quotes (I originally thought I would need them since I have a space in the path), I had to put the "-vm" before the "-vmargs", and I had to put the "-vm" on one line and the path on the next line. I was able to use either forward slashes or backslashes, but not a Windows environment variable.

Third, I only had to specify the path to the "bin" directory. I did not have to specify a particular file, such as "javaw.exe" or "jvm.dll".

Here is my entire eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jdk1.6.0_22/bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:

Tony Evans wrote:Also how do you get around the windows program file problem, all JDKS are stored there but eclipse does not like spaces. so C:\Program file\java is seen as C:\Program.

It also does not like "C:\Program file\java".



It's always recommended not to install Java (or any Java related utilities) in a folder containing a space in its path. It's better to move the Java installation outside the Program Files and then set the JAVA_HOME appropriately to point to the new path. For example, I have JDK 5 at C:/Java/jdk1.5.0


Out of ALL the answers in this thread.. This is the ONLY one that holds any value... Quite simply put, running Eclipse in a Windows environment, using spaces in the path does NOT work well with Eclipse -vm either in the command line OR the eclipse.ini file! If your Java\* is in the Program Files\ directory, MOVE IT OUT to C:\ or something, and update your environmental variables (ie: JAVA_HOME) accordingly (your PATH too if need be), and all will work 10000%, it's amazing such a SIMPLE fix causes 1,000s of google screams for HELP! :-)
 
Greenhorn
Posts: 5
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you have set up correctly the eclipse.ini config you might want to set the Installed JRE in eclipse to point to your jdk path.

For this go to Window -> Preferences -> Java -> Installed JRE's and add ( using the standard vm option ) the path to your local jdk.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i registered just to add my vote to this thread. In particular, I find Jeromy's reply on the differences very helpful. Thanks.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is doing my head in too..
I tried all the above suggestions including uninstalling all JRE..
All I have is jdk16_u17 no spaces etc etc etc..
The m2eclipse plugin still says Eclipse is running in a jre... On what does it base that ? How can we check if its true ?
If I look in the installation details config of eclipse it shows the vm=path to jdk/bin/java.exe as I would expect.
I also have the installed jres pointing to the jdk...
So a desperate plea for more suggestions to add to the long list...
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
More details please, we cannot help you if you don't provide specifics.

The m2eclipse plugin still says Eclipse is running in a jre


In what context? Are you getting a dialog box when Eclipse first comes up that gives this error? Or are you looking somewhere else? For example, even when running with an SDK, if you create new projects they might still show up as using a JRE. That is because the preferences still reference the JRE.

If you are getting the dialog box on startup, then your eclipse.ini file is set up wrong. Please post it.
 
hg smith
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks

Initially eclipse starts up happily no errors when the workspace is empty

Its when I do new>maven project that it gives me the dialogue box warning to check its running in a JDK
and puts in the the console

Eclipse is running in a JRE, but a JDK is required

When I restart eclipse with the maven project in the workspace it does the above immediately.

my eclipse.ini is as follows

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:/java/jdk1.6.0_17/bin/java.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m


 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are a few things to check:

1) Do these files exist:

c:/java/jdk1.6.0_17/jre/bin/client/jvm.dll
c:/java/jdk1.6.0_17/jre/lib/rt.jar
c:/java/jdk1.6.0_17/lib/tools.jar

2) Do the following registry key exists, and do they point to the c:/java/jdk1.6.0_17 directory:

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.6.0
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.6.0_17

3) In Eclipse, under Window | Preferences | Java | Installed JREs, what is the default installed JRE?

4) Could you upgrade to the latest JDK? I don't think that 1.6.0_17 is causing any problems, but ...
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot guys !! You have really helped me a lot ^_^
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have tried every suggestion the good people posted to this thread without success, until I removed the Java installation in my "Program Files" folder. Somebody / something made that installation there. Possibly when I downloaded and installed Eclipse Helios? Then I downloaded and installed the latest and greatest Java EE (with Glassfish) to the "C:" drive and updated the Eclipse.ini file to point to this new installation. I continued to have the problems outlined in this thread until I uninstalled the Java installation in the "Program Files" folder using Control Panel. Now Eclipse w/ Maven2 are no longer generating these messages.

enjoy
Gary
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Program Files is the worst possible location for installing the JDK, and that is the default location!!! What were they thinking? Having spaces in a path causes some Java code fits!
 
Gary Marshall
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What I see happening is this: Eclipse ignores the "-vm" parameter, if one is specified in its .ini file, if it finds a JRE installed in the "Program Files" directory. If there is no JRE installed in the "Program Files" folder then it checks for a "-vm" entry in its .ini file that points to a JDK / JRE.

If I am correct, then shouldn't such a critical piece of information be stated somewhere in the Eclipse installation instructions? Perhaps somebody who knows better can correct me if they find this piece of information stated somewhere in the Eclipse documentation and let us all know where this is stated.

thanks
Gary
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eclipse ignores the "-vm" parameter, if one is specified in its .ini file, if it finds a JRE installed in the "Program Files" directory.


That has not been my experience. If the -vm option appears in eclipse.ini, it will use that option. Try this - change the line after -vm to not point to a valid file and try to start Eclipse. I just now did that and got an error dialog stating that "no Java virtual machine was found." And I have the JRE in Program Files.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
G:\study\eclipse-jee-galileo-SR2-win32\eclipse\eclipse.exe -vm "E:\Program Files\Java\jdk1.6.0_23\bin\javaw.exe"

This works fine.

Regards,
Anadi KUMAR
Architecture and R2ds, Channels and Framework, Software Engineer | HSBC Technology and Services - Global Technology
HSBC Software Development (India)Limited
GLT 4.0 - Panchshil Tech. Park, Block D, S.No. 19, Hissa 2A/11/2, Yerawada, Pune, 411006.
India.

Mobile. +91 9822622054
Email. anadikumar@hsbc.co.in
Email. anadikumar@gmail.com
 
Greenhorn
Posts: 1
Oracle Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am using Eclipse IDE for Java Developers, Version: Helios Service Release 2. I solved this issue by inserting the following line in my eclipse.ini file;
-vm
C:\Program Files\Java\jdk1.6.0_18\jre\bin

This is how my eclipse.ini file looks like now;

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.6.0_18\jre\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A week ago, I had a perfect copy of Eclipse, with no errors.
On Thursday 7 July, it started giving the 'Eclipse is running in a JRE.... " message on startup for no apparent reason.

I tried many of the fixes suggested by the authors above based on previous experience.

JAVA_HOME points to C:\jdk1.6.0_25

I have now religiously gone through all the above suggestions to no avail
and now get two errors on starting Eclipse

1) Eclipse is running in a JRE.... "
2) 'Repository registry initialization' has encountered a problem

An internal error occurred during:"Repository registry initialization"

Details>>
Array index out of range.


If I click OK, the messages go away, and Eclipse gives the following when I run maven install

Unable to locate the Javac Compiler in:
[ERROR] C:\apps\liferay-portal-6.0.5\tomcat-6.0.26\jre1.6.0_21\win\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]

Eclipse is looking at my server runtime, instead of my compiler path.

I need the liferay/tomcat runtime in my project server path to resolve build and IDE edit dependencied.
The compile should be using my window->java->installedJRE selected JRE (the one that has JDK)

When I look in the properties for my project, I notice that the 'Targeted Runtime' is incorrect.
The correct runtimes are greyed out, and cannot be changed (I need dynamic web nad java 1.5 or greater)
ALL my runtimes are 1.5 or 1.6

If I run Maven on the command line, it works fine
If I open the project in Netbeans it works fine

The space in the path problem has been fixed in most other java apps a decade ago.

What I understand
a) Maven needs a JDK so that it can run its processes - this should come from PATH
b) Eclipse editor needs to know my runtime so it can find runtime dependencies (project properties?)
c) my .war file build needs to know what is in the Liferay environment (JRE)

WHat I cant find - the details of the rruntimes and servers - I can only find the names.

Any more ideas on where the problem may be?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the path given in the ERROR message:

[ERROR] C:\apps\liferay-portal-6.0.5\tomcat-6.0.26\jre1.6.0_21\win\..\lib\tools.jar

This tells me that C:\apps\liferay-portal-6.0.5\tomcat-6.0.26\jre1.6.0_21\\bin\java.ex (or javaw.exe) is the first JVM in the PATH, and thus is the one that Eclipse is picking up. Note that Eclipse does nothing with JAVA_HOME (though Maven when run from the command line does). Besides, the solution mentioned in this thread was not about setting JAVA_HOME, but rather adding the "-vm" entry into eclipse.ini (and you never posted that file). Also, saying:

I have now religiously gone through all the above suggestions to no avail


doesn't help, see ItDoesntWorkIsUseless

 
Chris Rowse
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter

Apologies, I had already noticed that Eclipse was picking up the Liferay JRE rather than the JDK
and did not make this clear in my posting.

In the .ini file I have tried (at line 18)
C:/jdk1.6.0_25/
C:/jdk1.6.0_25/jre/bin
C:/jdk1.6.0_25/bin

With both forward(/) and backward(\) file separators.
Most Java apps, I find, prefer forward slanting file separators, regardless of OS (Linux, Windows, MAC)

Files which may be of assistance in getting to the root of the problem

eclipse.ini


Environment


window->preferences->java -> Installed JREs

Installed JREs



your assistance is much appreciated
Chris
jdk.jpg
[Thumbnail for jdk.jpg]
Upload of window->preferences->java->installed JREs
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see that you are running a 64-bit OS and using 64-bit Eclipse. I hope that your JDK is also 64-bit. If it is, then I don't see what the issue is.

But there is something you can do to track it down - run Process Explorer from sysinternal. In Process Explorer, find the eclipse.exe process and look at the javaw.exe process that is under it. Make sure that that javaw.exe is using the correct jvm.dll (you will have to add the Path column to the bottom panel to see the full path for jvm.dll). It should be "c:/jdk1.6.0_25/jre/bin/server/jvm.dll"

Also, verify that c:/jdk1.6.0_25/lib/tools.jar exists.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:I see that you are running a 64-bit OS and using 64-bit Eclipse. I hope that your JDK is also 64-bit. If it is, then I don't see what the issue is,



This was my final step. I had to make sure I was using a 32-bit JDK with my apparently 32-bit Eclipse. I'll try to get 64-bit running at some point, but I'm just trying to get a look at some slightly outdated open source tool.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you set the -vm option for eclipse in ubuntu? I'm getting the same maven error on eclipse startup that this topic started with. Thanks ...
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setting -vm for Eclipse in Ubuntu is no different than for Windows - edit the eclipse.ini file as mentioned earlier. Here is what I have:

...
-vm
/usr/java/default/jre/lib/i386/client/libjvm.so
...

NOTE: I manually installed the JDK which I downloaded for Oracle's web site, and followed the general installation pattern used on Fedora (for example, the JDK gets installed into /usr/java/jdk1.6.0_29, with 'default' being a soft link to jdk1.6.0_29). I also manually installed Eclipse. I never use the Ubuntu package manager to install Java-related items.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:The key is that the -vm entry must come before the -vmargs entry. And the path to the JVM can be to java.exe, javaw.exe or jvm.dll. In either case what Eclipse is really looking for is the jvm.dll (or jvm.so on Linux) so that it can load it. I just point Eclipse directly to the jvm.dll.



This was the change that got my settings to work.
Thanks Peter.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alister Ernest wrote:

Peter Johnson wrote:The key is that the -vm entry must come before the -vmargs entry. And the path to the JVM can be to java.exe, javaw.exe or jvm.dll. In either case what Eclipse is really looking for is the jvm.dll (or jvm.so on Linux) so that it can load it. I just point Eclipse directly to the jvm.dll.



This was the change that got my settings to work.
Thanks Peter.


Also worked for me. Thanks!
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After doing most of the suggestions here - what finally got it to work for me was to put it as part of my shortcut command:

C:\KEG_Programming\eclipse\eclipse.exe -vm "C:\Program Files\Java\jdk1.6.0_41\jre\bin\server"

I'm not sure why just having it in the .ini didn't work for me. It works for a co-worker AND he has it in "Program Files" rather than installing it in his own.
Here's my .ini file - and I tried it w/ quotes & no quotes as shown here:


The only iffy part might be how I have the installed jre setup in Eclipse's window properties. Should it be to the JDK or the JRE in the Java folder?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do NOT use backslashes in the .ini file - backslashes are treated as escape characters. Use forward slashes instead!
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic