I have installed the TestNG 6.9.9 Eclipse plugin.
My project java compiler setting is set to 8.0.65.
If I execute an Test with TestNG i got following error:
"VM version 1.6.0 is invalid, Java 1.7 or above is required for running TestNG."
I can change the JRE in the "Run Configurations" for the executed test but it is stuck with 1.6 How do I change this ?
A Java 8.0 Version is installed on the system, but it looks like, that the plugin use the JRE configuration from my project.
TestNG usually takes the Project Execution environment JRE. If you've changed the JRE from 1.6.x to 1.7 or 1.8 then it should work. Just to make sure the steps,
1) Open the Test file
2) Go to Run configurations
3) open JRE tab
4) click on Alternate JRE and select JDK/JRE > 1.6
I removed JRE System Library v6 and added current version (v8 in my case) via "Add Library"
I had a similar problem and deleted all of the 1.6 JREs from my Eclipse preferences. You can still build 1.6 projects under a 1.7/1.8 JRE, so 1.6 probably isn't needed.
Related
I have both Net-beans and eclipse IDEs installed in my laptop, But there is a per-devolved system that want lower version of JDK. so I installed net-beans older version too. but then JDK does not support my eclipse version. can I use two JDK in once?? and what should I do for working in both IDE in different versions.
Eclipse / Net beans need JRE to run in first place. If the version of JRE you install is not supported by the version of Eclipse/Netbeans u have, then you have to get a compatible version of Eclipse/Netbeans that match your installed JRE. (Alternatively you can change the JRE version)
Now coming to JDK. You need JDK only to compile you code inside Eclipse/Netbeans. You can have any number of JDKs installed and you can configure 'per project'.
In Eclipse, this is how you configure the JDK for the project
Java Build Path -> Libraries -> Add Libraries -> JRE System Library
In the next screen you add the desired JDK from your system , by locating it in the file browser.
P.S : Havent used Netbeans, but sure it is supported
I have java jdk 1.6 update 1 installed on my pc as well as jdk 1.8.0_11, my eclipse uses the 1.6 version, how do i change it to 1.8 and on doing so, will I need to change any further setting for android application development?
In your Eclipse IDE go to Window->Prefernces->Java->Complier
and set Compiler compliance level to required version
UPDATE: You need a newer version of Eclipse. At least 3.7SR1.
In your project in Eclipse you can select "Project -> Properties" and then go to "Java Compiler", then uncheck the checkbox "Use compliance from execution environment 'JavaSE-1.6' on the 'Java build path'".Then select the complier compliance level.
Right click on project - Build Project - Libraries- Add Library - Select the desired Java Version (Alternate one)
I have jre8 installed and set as the default for the jre but under compiler compliance I can't find 1.8 and under execution environment I can't find javaSE 1.8. I'm using the latest build of Eclipse EE.
I took a look at this manual
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm
But I couldn't find any .ee files in my jre8 or JDK1.8 installation directories.
Open Preferences and look in 'Java > Installed JREs'. If you don't have a Java 8 shown there click 'Add...' to add it. Close the preferences.
Open Preferences again and look in 'Java > Installed JREs > Execution Environments', select 'JavaSE-1.8' and make sure your Java 1.8 is checked as the Compatible JRE
If the eclipse version is old as #mike stated in his answer then you would be unable to view the JavaSE-1.8 on the Execution Environments list in your eclipse; You can do the following to use it even on older versions:
Help --> Install New Software
Place the following URL --> http://download.eclipse.org/eclipse/updates/4.3-P-builds/
Install the plugins and restart eclipse.
Now if you have JDK 1.8 on your computer and added it as an installed JRE you'd be able to view and use JavaSE-1.8
Or just download and use the latest eclipse
Older versions of Eclipse might not work with javaSE-1.8
You need to find out what version of Eclipse you have by going into its help menu and clicking on About Eclipse.
If your version is older than the one at https://www.eclipse.org/downloads/
then you need to uninstall your older version and install the latest version.
I had the same problem with my Eclipse on Linux Mint. And the only way I could solve it was by following above instructions.
I am writing my code in eclipse, the code is running fine but when I try to build it in ant by running build.xml. I am getting
Java Virtual Machine Launcher: Could not find the main class. Program will exit.
Any suggestions?
if you are using java 1.6 and upgraded eclipse, it's more likely caused by eclipse the solution is to go to Run as → External tools configuration… → JRE where the default was set to “Separate JDK”: jdk1.6.0_31 and change this to “run in the same JRE as the workspace” (1.7/1.8), and it should works.
Bug fix would be to provide a working default configuration with setup. Configuration should be in a way it does not break if the user adds additional JDKs to Preferences.
for more details you can see Bug 472599
You need to verify few things
1) Is the path to java bin directory set properly?? (To check this you need to write command javac in command prompt(cmd) and you will get a list of instructions on cmd console) 2) Open the eclipse and go to Window-> Preferences-> Ant-> Runtime in the Classpath tab, see Ant Home Entries pointing to the wrong directory (it still points to the last directory, this directory does not exist) you have to do is to change the Ant Home pointing to the correct directory, to point Ant Home button select Ant Home directory, for example, I use Eclipse 3.3.1, Ant Home is the Eclipse plugin directory org.apache.ant_1. 7.0.v200706080842.
Right click on the build.xml file and select Run As --> External tool configurations --> Jre --> Select Run in the same JRE as the workspace.
If you are using Java 1.5 (that is, it is specified in your workspace, project or ant configuration as the JVM to use), it is also caused by a bug/feature in Eclipse: Java 1.5 is no longer supported. You need to upgrade to Java 1.6.
See: Eclipse bugs 421423
The version of ant you're using may not be compatible with the version of java you are using. I have ant 1.9.4 and was trying to run with java 1.4 and got this same error. Running with java 1.7 fixed it for me!
Error I was facing :
"Could not find the main class :
org.eclipse.ant.internal.launching.remote.internalAntRunner. Program will exit."
To compile my code with JDK 1.8, i have added external ANT to my eclipse, which was working fine. But compiling the code with JDK 1.6 with same ANT version was not working.
Solution : I restored the ANT in to its default value by selecting " Restore Default Entries " ( ANT --> Run as --> External Tools configurations --> classpath" ), after that ANT with JDK 1.6 is working fine.
Above error was happening for me when i added external ANT to my eclipse which was compatible with JDK 1.8 usage. Ant was working with JDK 1.8, the same was not working with 1.6 JDK. Once i restored ANT classpath settings to its default eclipse values which was JDK 1.6 compatable, above error was gone.
I went through and uninstalled all Java from my computer. Then I installed JavaSE JDK1.7. I then modified Eclipse configuration so it would start and opened it up. I have an Ant script to build my project and I want to build my project against 1.7, but whenever I run the script, it says
'Launching PROJECT build.xml' has encountered a problem.
Specified VM install not found: type Standard VM, name jdk1.6.0_21
The installed JRE in Eclipse is 1.7 and nothing else. I cannot for the life of me find how to change what Ant is looking for.
This is because you still have the old JDK configured as JRE in the External Tools Configuration" in eclipse - open it via the arrow menu next to this button in the toolbar: , then change it to the Java 7 JDK.
In Eclipse, click the ant file -- Run As -- External Tools Configuration and click on the JRE tab.
Select "Run in the same JRE as the workspace"
Delete the "C:\Users\%USERNAME%\workspace.metadata.plugins\org.eclipse.debug.core.launches\%PROJECT_NAME% build.xml.launch file"
That solved problem for me.