but thisif this had com...

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
When try to connect to the mysql server through my rails application, I get the following error
D:/Program_Files/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
Incorrect MySQL client library version! This gem was compiled for 6.0.0 but the client library is 5.0.27. (RuntimeError)
How can I rectify it?
4,49711114
3,558113667
I had the same problem as you, or at least the symptom was the same.
Background: I was using Rails 3, the mysql2 gem, and MySQL community server version 5.5.21 (32-bit) installed locally on my Windows machine. I grabbed the client library (libmysql.dll) from the MySQL installation and copied it to my ruby installation's bin folder.
When I ran bundle exec rake db:create, I got the same error message as you and I thought "Hey, how can the client library be outdated when I got it from the latest MySQL release?"
There's a helpful message that is shown when you gem install mysql2. Unfortunately, if you install the gem with Bundler, Bundler eats the message. Here it is:
=========================================================================
You've installed the binary version of mysql2. It was built using MySQL
Connector/C version 6.0.2. It's recommended to use the exact same version
to avoid potential issues.
At the time of building this gem, the necessary DLL files where available
in the following download:
/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
And put lib\libmysql.dll file in your Ruby bin directory, for example
C:\Ruby\bin
Following these instructions solved the problem for me.
9,54762552
Uninstalling and reinstalling the gem will often solve this issue with no need to download and move files around by hand. From your rails app directory:
& gem uninstall mysql2
You have requested to uninstall the gem:
mysql2-0.3.11
database_cleaner-0.9.1 depends on [mysql2 (&= 0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]
Successfully uninstalled mysql2-0.3.11
& bundle install
Fetching gem metadata from http://rubygems.org/......
Fetching gem metadata from http://rubygems.org/..
Using rake (0.9.2)
Using i18n (0.6.1)
... &SNIP& ...
Installing mysql2 (0.3.11) with native extensions
... &SNIP& ...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
If you are using 64bit version of mysql and 32bit version of ruby, then check this solution on
You basically have to download a single connector from mysql website, and compile mysql or mysql2 with connector you downloaded.
for Ruby 1.9.2:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
for Ruby 1.9.3: (showing mysql2 variant)
gem pristine mysql2 -- --with-mysql-config=C:\mysql-connector-c-noinstall-6.0.2-win32
Note the use of forward slashes for the directory where MySQL Connector/C was extracted.
1,72311332
3,70073965
in my case on windows, incorrectly copied libmysql.dll from MySQL Server 5.5 directory to ruby200/bin. correct is to copy libmysql.dll from mysql-connector-c-noinstall-6.0.2-win32.
I discovered a completely different cause for this problem.
I had been using the mysql gem.
I built the mysql2 gem but I forgot to update my database.yml.
With the mysql2 gem, it needs to say:
development:
adapter: mysql2
rather than
development:
adapter: mysql
The gem built, but I got the error when I next ran rake.
Obvious once you've seen it, but you get the same error message as discussed here!
By the way, the command to build the mysql2 gem on my machine was a bit more complicated than described above:
gem install mysql2 -- --with-mysql-lib="c:\mysql-connector-c-noinstall-6.0.2-win32\lib"
--with-mysql-include="c:\mysql-connector-c-noinstall-6.0.2-win32\include" --with-mysql-dir="c:\mysql-connector-c-noinstall-6.0.2-win32"
9,54762552
I had an issue just like this:
Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.17.
The issue for me was that I had both versions, 5.5.29 and 5.6.17, installed on my machine. I have no idea how. When I bundled it automatically chose the 5.5.29 version. I uninstalled that one and then reinstalled my gem and that fixed the issue.
To Add to the existing answer. ( windows platform specifically )
Ruby really sucks on top of this. Rails should not actually care about the version of the connector or
the mysql version. -- but that's my opinion.
In order to get this **ing thing working, you need 2 things. mysql2 gem and libmysql.dll and you need to match them up in terms of the version. (this caused confusion for me, because I can see the latest connector is 6.x while mysql is only 5.x, how should I match them up)
mysql2 gem. and when you install it you need to specify the connector.
gem install mysql2 --platform=ruby --
--with-mysql-lib="d:\mysql\lib" --with-mysql-include="d:\mysql\include"
it does not need to be connector downloaded from oracle. all you need is a mysql installation and the lib include folder underneath it. then put the libmysql.dll under railsinstaller bin folder.
if it didn't work to make you install mysql2 gem succesfully => for my case it is because my mysql is too old (why would ruby care that). so I get some latest mysql from oracle. use the
lib include libmysql.dll under it. you don't really need to upgrade your database, you can keep it somewhere and continue to use it after you generated the 2 required components
my case: I use a very ancient mysql database and I am unwilling to upgrade it at the moment. so I back that database up and restored it later
I had the same problem , and I have solved the follows:
1 :: Download the zip the following link:
2 :: decompress the file ( libmysql.dll ) in the " Provider" folder of project.
3 :: Volve one to run the command bundle install
and ready , solved !
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledEclipse is running in a JRE, but a JDK is required (IDEs and Version Control forum at JavaRanch)
File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Win a copy of
this week in the
Eclipse is running in a JRE, but a JDK is required
I have set up
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
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
-Dosgi.requiredJavaVersion=1.5
C:\JavaJDK\Java\jdk1.6.0_01\bin\javaw.exe
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
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
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 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
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.
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.
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
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.
Problem solved thanks to java ranch on anoher thread here is he correct setting in the eclipse.ini file
C:\JavaJDK\Java\jdk1.6.0_01\jre\bin\client\jvm.dll
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
C:\JavaJDK\Java\jdk1.6.0_01\jre\bin\client\jvm.dll
-Dosgi.requiredJavaVersion=1.5
W I just use javaw.
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.
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.
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
and the path.
So in the eclipse.ini file:
THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe
BUT THIS WILL:
C:\java\jdk\bin\javaw.exe
Yes, each token in eclipse.ini must be on its own line.
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
and the path.
So in the eclipse.ini file:
THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe
BUT THIS WILL:
C:\java\jdk\bin\javaw.exe
Thanks a Lot....
The trick saved my time..
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:
plugins/org.eclipse.equinox.launcher_1.1.0.v.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1.R36x_v
org.eclipse.epp.package.jee.product
--launcher.defaultAction
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--launcher.defaultAction
C:/Program Files/Java/jdk1.6.0_22/bin
-Dosgi.requiredJavaVersion=1.5
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! :-)
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.
i registered just to add my vote to this thread. In particular, I find Jeromy's reply on the differences very helpful. Thanks.
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...
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.
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
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v0.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v
org.eclipse.epp.package.java.product
--launcher.defaultAction
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--launcher.defaultAction
C:/java/jdk1.6.0_17/bin/java.exe
-Dosgi.requiredJavaVersion=1.5
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 ...
Thanks a lot guys !! You have really helped me a lot
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.
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!
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.
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.
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.
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.
Mobile. +91
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.
C:\Program Files\Java\jdk1.6.0_18\jre\bin
This is how my eclipse.ini
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v0.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v
org.eclipse.epp.package.java.product
--launcher.defaultAction
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--launcher.defaultAction
C:\Program Files\Java\jdk1.6.0_18\jre\bin
-Dosgi.requiredJavaVersion=1.5
If you can find a path with no obstacles, it probably doesn't lead anywhere
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&
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?)
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?
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
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
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v0.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v
org.eclipse.epp.package.jee.product
--launcher.defaultAction
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--launcher.defaultAction
C:/jdk1.6.0_25/jre/bin/javaw.exe
-Dosgi.requiredJavaVersion=1.6
Environment
C:\Users\Chris&set
ALLUSERSPROFILE=C:\ProgramData
ANT_HOME=C:\apps\apache-ant-1.8.2
APPDATA=C:\Users\Chris\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=ELM
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Chris
JAVA_HOME=C:/jdk1.6.0_25
LM_LICENSE_FILE=c:\flexlm\License.dat
LOCALAPPDATA=C:\Users\Chris\AppData\Local
LOGONSERVER=\\ELM
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\Program Files (x86)\CollabNet\Subversion CC:\Actel\Libero_v9.0\Model\win32C:\Actel\Libero_v9.0\Designer\C:\Program Files (x86)\NVIDIA Corporation\PhysX\Comm
C:\Windows\system32;C:\WC:\Windows\System32\WC:\Windows\System32\WindowsPowerShell\v1.0\;C:/jdk1.6.0_25\C:\apps\apache-ant-1.8.2\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SYNPLCTYD_LICENSE_FILE=c:\flexlm\License.dat
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Chris\AppData\Local\Temp
TMP=C:\Users\Chris\AppData\Local\Temp
USERDOMAIN=Elm
USERNAME=Chris
USERPROFILE=C:\Users\Chris
windir=C:\Windows
C:\Users\Chris&
window-&preferences-&java -& Installed JREs
your assistance is much appreciated
Upload of window->preferences->java->installed JREs
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 . 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.
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.
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 ...
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:
/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
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.
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.
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.
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:
plugins/org.eclipse.equinox.launcher_1.3.0.v3.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v3
org.eclipse.epp.package.jee.product
--launcher.defaultAction
--launcher.XXMaxPermSize
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
--launcher.defaultAction
C:\Program Files\Java\jdk1.6.0_41\jre\bin\server
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
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?
Do NOT use backslashes in the .ini file - backslashes are treated as escape characters. Use forward slashes instead!
Here's the link:
subject: Eclipse is running in a JRE, but a JDK is required
Similar Threads
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter}

我要回帖

更多关于 if you ever had 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信