I am trying out BDD with Specflow in Visual Studio 2017. Previously I had created a new project and added Specflow and Nunit using NuGet Package Manager. From the Solution Explorer, I right click and select Add New Item. From the Add New Item window, I could see SpecFlow feature File and Feature.cs file
But I open the Feature.cs it's showing empty with the message
<#error Generation error: The element may only appear once in this section.>
Then I try to build the solution then I'm getting error on Output
Error CS1029
error: 'Generation error: The element may only appear once in this section.'
The references I can see from Solution Explorer are: SpecRun.SpecFlowPlugin TechTalk.SpecFlow TechTalk.SpecRun NUnit.VisualStudio.TestAdapter
Am I missing something?
Thanks, Mohammed
If you have a scenario outline, but you for get to write the Examples-Keyword, you will get the following error during the build process:
CS1029 #error: 'Generation error: Sequence contains no elements' in Line 1 of MyFeature.feature
It took me some hours in my large created feature file to locate my error. I deleted the temp files, restarted visual studio several times, but it was difficult to figure out why it occurs.
Could you somehow improve the error messages e.g. with a better location, a simple syntax check before or something similar?
As far as I understand, the ScenarioOutline, followed by a will allways need at least an Examples keyword and a table with this varname, before an other Tag like Scenario, etc. is allowed again. I would appreciate to have such markup
?xml version="1.0" encoding="utf-8"?>
configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
<add name="SpecRun" />
</plugins></specFlow>
</configuration>
Related
I just did an update to VS2019(16.9.0) and now I get this message. (actually on two machines). A restart does not resolve the problem.
What is the CascadePackage?
Can I just say No to dialogue box and be OK?
Also...the file it mentions to examine...does not exist anymore, nore the directory it was in.
I did find this line in the latest ActivityLog.xml
<entry>
<record>894</record>
<time>2021/03/05 13:52:21.259</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [CascadePackage]Source: 'System.ComponentModel.Composition' Description: The composition produced multiple composition errors, with 3 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage
2) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") --> Microsoft.VisualStudio.Cascade.CascadePackage
3) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
Resulting in: Cannot set import 'Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")' on part 'Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") --> Microsoft.VisualStudio.Cascade.CascadePackage
</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
Seem like this was caused by LiveShare.
From Visual Studio Developer Community
Just search for
The 'CascadePackage' package did not load correctly
As for my two issues:
On one machine...the error went away by starting VisualStudio.
On another machine I went into Tools->Get Tools and Features...
Click on Individual components search for Live Share. Uncheck it.
Restart VS.
Go back into Tools->Get Tools and Features... Click on
Individual components search for Live Share. Check it back.
More about the ActivityLog...
Visual Studio uses a /log option on update. This creates the ActivityLog.xml.
More here /Log (devenv.exe) This is something you can also do yourself.
The description part of the ActivityLog.xml will list where the problems are. Here is an edited breakdown of the original message in the OP.
<entry>
<record>894</record>
<time>2021/03/05 13:52:21.259</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [CascadePackage]Source: 'System.ComponentModel.Composition'
Description: The composition produced multiple composition errors, with 3 root causes.
The root causes are provided below.
Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
RequiredTypeIdentity Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler
Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.JoinWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IJoinCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage
2) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
RequiredTypeIdentity
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler
Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ShareWorkspaceCommandHandler (ContractName="
Microsoft.VisualStudio.Cascade.Commands.IShareCommandLineHandler") -->
Microsoft.VisualStudio.Cascade.CascadePackage
3) No exports were found that match the constraint:
ContractName
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
RequiredTypeIdentity
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService
Resulting in: Cannot set import '
Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService")' on part '
Microsoft.VisualStudio.Cascade.CascadePackage'.
Element: Microsoft.VisualStudio.Cascade.CascadePackage.ClientService (ContractName="
Microsoft.VisualStudio.Cascade.Contracts.IVsCascadeClientService") -->
Microsoft.VisualStudio.Cascade.CascadePackage
</description>
<guid>{D86E17D6-7FC7-47F4-9259-21748EDFF93B}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
To fix this error, please update to Visual Studio 16.9.2 - it has been fixed there. It's also mentioned in the Release Notes:
Fixed an issue causing an error message indicating the CascadePackage did not load correctly
I am on version 16.9.4 and still experiencing this issue. However I was able to get around it by either enabling or disabling the LiveShare extension (Extensions >> Manage Extensions >> Installed >> Live Share), and then recent VS.
If this doesn't work try reverting to the previous version, or updating it.
Sometimes I have to try the above a couple of times to get it working.
Usually this error goes away on its own, after upgrading the Live Share extension and rebooting Visual Studio a couple of times (usually at least three times).
However, sometimes, that does not work. In these cases, cleaning the MEF cache as described manually (by deleting the content of %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache), or automating it via the extension Clear MEF Component Cache have solved the problem.
Clearly, if you do not wish to use Live Share, you could just disable it from the Extensions menu and the package will not even be loaded by Visual Studio.
Update: I noticed that the issue sometimes occurs even with Live Share disabled. In all my (many) attempts, toggling it resolved the startup issue after clearing the MEF cache.
I am creating build for solution which has 2 projects (ssis,ssrs and SSAS) i am getting below error. I think this is because of SSRS in the solution. I have taken VS build and passed MSBuild arguremnts: /ignore:.dtproj,.rptproj
Error messages:
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
Process 'msbuild.exe' exited with code '1'.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71):C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71,7): Error MSB4062: The "Microsoft.AnalysisServices.VSHostBuilder.SemanticModelGetOutputFilesTask" task could not be loaded from the assembly O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll. Could not load file or assembly 'file:///O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Process 'msbuild.exe' exited with code '1'.
I use ReSharper 2017.2.2 on the development machine together with Visual Studio 2017.5.
I'm using TFS 2017 Update 3.
On the TFS server, Visual Studio 2017.4 and ReSharper CLT 2017.2.2 are installed.
I'm using TFS build.
My goal is to do code analysis when building a solution.
I use the Resharper Code Quality Analysis task. I can configure it using the sln.DotSettings file which is at the root of the solution.
Standard code checks ReSharper successfully work. I can also change the warning level as shown here https://marketplace.visualstudio.com/items?itemName=alanwales.resharper-code-analysis
For this I use ReSharper -> Options | Code Inspection -> Custom patterns.
This rule works well in Visual Studio. When I save this rule to sln.DotSettings, the following lines are added:
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=4E6B3830DEEA6148909C23CD21C96E28/#KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=4E6B3830DEEA6148909C23CD21C96E28/LanguageName/#EntryValue">JAVA_SCRIPT</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=4E6B3830DEEA6148909C23CD21C96E28/MatchCatchClauseWithoutExceptionFilter/#EntryValue">False</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=4E6B3830DEEA6148909C23CD21C96E28/SearchPattern/#EntryValue">debugger</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=4E6B3830DEEA6148909C23CD21C96E28/Severity/#EntryValue">ERROR</s:String></wpf:ResourceDictionary>
I in the JS code specially added lines with debugger. But I do not get a warning on my custom patterns.
Does Resharper Code Quality Analysis support in TFS use Custom patterns?
UPDATE 1: I checked the launch of the code analysis via the console with the command: InspectCode.exe -o="C:\temp\Results.xml" --no-swea "C:\BuildAgent\Thompson\_work\23\s\***.sln"
In the Results.xml file, I found the required line:
<Issue TypeId="StructuralSearch" Severity="ERROR" File="***.WebResources\WebResources\new_\js\forms\***.js" Offset="406-415" Line="13" Message="debugger" />
UPDATE 2: I looked at the script code RunResharperCodeAnalysisTool.ps1. In this file there are the following lines:
...
$severityLevels = #{"Hint" = 0; "Suggestion" = 1; "Warning" = 2; "Error" = 3}
...
foreach($issue in $issuesElements) {
$severity = #($issuesTypesElements | Where-Object {$_.Attributes["Id"].Value -eq $issue.Attributes["TypeId"].Value})[0].Attributes["Severity"].Value
$severityLevel = $severityLevels[$severity]
if($severityLevel -ge $severityLevels[$failBuildLevelSelector]) {
$item = New-Object -TypeName PSObject -Property #{
'Severity' = $severity
'Message' = $issue.Attributes["Message"].Value
'File' = $issue.Attributes["File"].Value
'Line' = $issue.Attributes["Line"].Value
}
$filteredElements.Add($item)
}
}
The Results.xml file has the following lines:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by JetBrains Inspect Code 2017.2.2 -->
<Report ToolsVersion="109.0.20171006.123742">
<Information>
<Solution>..\..\BuildAgent\Thompson\_work\23\s\***\***.sln</Solution>
<InspectionScope>
<Element>Solution</Element>
</InspectionScope>
</Information>
<IssueTypes>
<IssueType Id="StructuralSearch" Category="Structural Search Highlightings" CategoryId="StructuralSearch" Description="Structural Search Pattern" Severity="INVALID_SEVERITY" />
<IssueType Id="WebConfigErrors" Category="WebConfig Errors" CategoryId="WebConfigErrors" Description="" Severity="ERROR" />
</IssueTypes>
<Issues>
<Project Name="***">
<Issue TypeId="WebConfigErrors" File="***.WebResources\Web.config" Offset="531-650" Line="17" Message="Invalid module qualification: Failed to resolve assembly Microsoft.CodeDom.Providers.DotNetCompilerPlatform" />
<Issue TypeId="WebConfigErrors" File="***.WebResources\Web.config" Offset="916-1035" Line="20" Message="Invalid module qualification: Failed to resolve assembly Microsoft.CodeDom.Providers.DotNetCompilerPlatform" />
<Issue TypeId="StructuralSearch" Severity="ERROR" File="***.WebResources\WebResources\new_\js\forms\***.js" Offset="406-415" Line="13" Message="debugger" />
</Project>
</Issues>
</Report>
My Custom Patterns has Severity="INVALID_SEVERITY" which is not on the $severityLevels list.
Since it works well with the command line, seems the issue is not related to TFS side, may more related with the 3-party task.
If this will not work with the Resharper Code Quality Analysis task, you could directly call the InspectCode.exe command during the build task by use a command line task or customize extension. Then publish the result file to TFS.
Besides, as a workaround, you could also be able to return warnings and errors from your powershell script using logging commands. With using task.logissue type=error you could fail the build task and then fail the build.
I am trying to compile jabber-net in Xamarin Studio so I can use it in a Xamarin.iOS app.
From other searches I have done I am told I need to recompile the source.
From command line I can build the dll, but I have no idea what version of .NET/Mono this is targeting.
This makes a jabber-net.dll and a jabber-net.dll.mdb.
If I add jabber-net.dll to my project, add the reqiured
using jabber.client;
...
...
...
JabberClient client = new JabberClient ();
and try to compile I am told.
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,47): error CS0584: Internal compiler error: Could not import type jabber.client.JabberClient' fromjabber-net, Version=2.1.0.702, Culture=neutral, PublicKeyToken=924c5b18328d6f09'
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,38): error CS0584: Internal compiler error: Could not import type jabber.client.JabberClient' fromjabber-net, Version=2.1.0.702, Culture=neutral, PublicKeyToken=924c5b18328d6f09'
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,38): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
I got no idea what is going on here...
When I try to open any of the .sln's (or include any of the existing projects, even the mono specific project) that came with jabber-net into my solution it will either hang trying to convert the project, or will tell me
The file '/Users/brad/Projects/XMPPChat/JabberNet-2.1.0.710/mono-jabber-net.csproj' could not be loaded.
and will spit out this error.
Any idea where to go from here? :|
Start a new solution from scratch, and add all of the .cs files except those in the test and examples directories. Also make sure you don't have an old version of the .dll around somewhere.
Posting here is always my last resort, but I'm going crazy here. I'm a Mule ESB beginner. I've been trying to do some simple examples to get me on the right track.
But I've encountered a problem with one of the examples I've seen on the mule website...
http://www.mulesoft.org/documentation/display/current/WSDL+Connectors
I'm trying to set up a generic WSDL endpoint, which invokes a web service without generating a client.
The WSDL I'm trying to access...
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL&method=ConversionRate
The problem is, I keep getting the following error
[ERROR] IOException during exec() of compiler "javac". Check your path environment variable.
ERROR 2013-04-19 09:27:07,920 [[soap].soapFlow1.stage1.02] org.apache.cxf.endpoint.dynamic.DynamicClientFactory: Could not compile java files for http://www.webservicex.net/CurrencyConvertor.asmx?WSDL&method=ConversionRate?wsdl.
ERROR 2013-04-19 09:27:07,934 [[soap].soapFlow1.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException)
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (javax.xml.bind.JAXBException)
com.sun.xml.bind.v2.ContextFactory:183 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/bind/JAXBException.html)
2. Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (javax.xml.bind.JAXBException)
javax.xml.bind.ContextFinder:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/bind/JAXBException.html)
3. Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException)
org.apache.cxf.endpoint.dynamic.DynamicClientFactory:363 (null)
4. Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException) (org.mule.api.DefaultMuleException)
org.mule.module.cxf.builder.AbstractOutboundMessageProcessorBuilder:96 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/DefaultMuleException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
And yes, I've hunted around the internet for hours looking for a solution.
Things I've done to try fix the problem.
Make sure the javac path is set in the environment variables.
(%JAVA_HOME%\bin)
Make sure that mule studio has the correct path to JRE
I know it's a simple problem, but I need to figure it out to tackle a larger project that I have in mind.
If anyone could shed some light on a solution this problem, then I'd be extremely grateful.
Thanks :)
Other info:
Using Java 1.7
Using MuleStudio 3.4
Ok, after trying and failing at many different solutions, I've figured it out.
I've seen a lot of people asking the same question as me, with very few solutions.
Here is mine...
The JRE was incorrect.
My java directory consisted of..
And Mule studio was using the folder jre7
So I changed it to use the JRE in the directory jdk1.7.0_17/jre
Ran it again and.. OMG it worked!!
Here is how to do it in mule studio/eclipse...Right Click on your Project --> Properties --> Java Build Path --> Libraries Tab --> Click JRE System Library --> Press Edit --> Click Alternate JRE --> Click Installed JREs.. --> Then Add the JRE from the correct directory like I stated above.
Hope this helps anyone with the same problem! :)