简体   繁体   English

ubuntu中的Maven JRE错误:Eclipse正在JRE中运行,但需要一个jdk

[英]Maven JRE error in ubuntu:Eclipse is running in JRE but a jdk is required

Can anybody help in Eclipse maven error in ubuntu.I found the soln in windows but in ubuntu(linux) im unable to remove the Eclipse maven error." Eclipse is running in JRE but a jdk is required". 任何人都可以帮助解决ubuntu中的Eclipse maven错误。我在Windows中找到了soln,但是在ubuntu(linux)中却无法消除Eclipse maven错误。“ Eclipse在JRE中运行,但需要jdk”。 I have JDK6 installed in ubuntu. 我在ubuntu中安装了JDK6。

$java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

$ which java
/home/ali/Jdk6/bin/java

Please Help. 请帮忙。

I had the same problem, and found a lot of fixes for Windows but not for Ubuntu. 我遇到了同样的问题,并且发现了许多针对Windows的修复程序,但没有针对Ubuntu的修复程序。

This seems to be working for me in Ubuntu 12.04, with Eclipse Juno: 在Eclipse Juno的Ubuntu 12.04中,这似乎对我有用:

I followed the instructions here to install Sun Java JDK 6: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/ 我按照此处的说明安装Sun Java JDK 6: http : //www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

(if you already have Sun Java JDK installed, then maybe just try the parts labelled "Choose default java" and "Verify the symlinks".) (如果您已经安装了Sun Java JDK,则可以尝试标记为“选择默认Java”和“验证符号链接”的部分。)

Then I added the following to my eclipse.ini file: 然后,将以下内容添加到我的eclipse.ini文件中:

-vm
/usr/lib/jvm/jdk1.6.0_32/bin/java

Note that it seems you have to put the new line in, and it must go in the right place in the file, after --laucher.defaultAction but before -vmargs. 请注意,似乎您必须放入新行,并且它必须放在文件的正确位置,在--laucher.defaultAction之后,但在-vmargs之前。 So my full eclipse.ini now reads: 所以我的完整eclipse.ini现在显示为:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
-Dandroid.sdk.path=/home/gguser/android-sdk-linux
openFile
-vm
/usr/lib/jvm/jdk1.6.0_32/bin/java
-vmargs
-Xms512m
-Xmx512m

That may be the your default Java installation, but it doesn't mean that's your only Java installation. 这可能是您的默认 Java安装,但这并不意味着那是您唯一的 Java安装。 Assuming you haven't installed any by hand, you should look in Synaptic to see if you have sun-java6-jre installed in addition to sun-java6-sdk (note that sun-java6-jre installs in a subdirectory of where sun-java6-sdk installs. You may also have OpenJDK installed, et al. 假设您尚未手动安装任何软件,则应在Synaptic中查看除sun-java6-sdk之外是否还安装了sun-java6-jre(请注意,sun-java6-jre安装在sun-java-的子目录中)。您可能还已经安装了OpenJDK等。

Next, be aware that Eclipse does NOT use $JAVA_HOME to find a JDK to run under. 接下来,请注意,Eclipse不使用$ JAVA_HOME查找要在其下运行的JDK。 The VM to use is defined in the eclipse.ini config file, and if one isn't defined there, it looks for a JRE installed under its own directory. 要使用的VM在eclipse.ini配置文件中定义,如果未在其中定义,它将查找安装在其自己目录下的JRE。

See this page for more information. 有关更多信息,请参见此页面

Solved: m2eclipse: Eclipse is running in a JRE, but a JDK is required 已解决:m2eclipse:Eclipse在JRE中运行,但是需要JDK

G:\\study\\eclipse-jee-galileo-SR2-win32\\eclipse\\eclipse.exe -vm "E:\\Program Files\\Java\\jdk1.6.0_23\\bin\\javaw.exe" G:\\ study \\ eclipse-jee-galileo-SR2-win32 \\ eclipse \\ eclipse.exe -vm“ E:\\ Program Files \\ Java \\ jdk1.6.0_23 \\ bin \\ javaw.exe”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM