I've Eclipse for quite a while, but I recently just came across an error that is really bugging me right now because I can't use the debugger. I can run my program normally, but not the debugger. This is what I get when I try to run with the debugger:
'Launching CarLoanUser' has encountered a problem Cannot connect to VM Cannot connect to VM com.sun.jdi.connect.TransportTimeoutException
and in the console:
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) ERROR: transport error 202: connect failed: Permission denied ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
I've tried a lot of things concerning it:
- restart Eclipse
- restart my computer
- Try another code I own
- Reinstall Eclipse (Luna)
- Delete Eclipse (Luna) and replace it with Eclipse Java EE (Kepler)
- Go back on Eclipse (Luna)
- Uninstall all instances of Java and install Java 8
- Uninstall Java 8 and install Java 7 (All Java installation are with the 64-bit installator)
- Clean the registery with ccleaner
I'm currently running on Windows 8.1 64-bit
If it might help, I'll include the code I'm currently working on
import java.util.Scanner;
import java.text.NumberFormat;
/**
* Title: CarLoanUser
* Description:
* @author
* @version 1.0
*/
public class CarLoanUser {
/**
* @param args
*/
public static void main(String[] args) {
runWithConsole();
}//main(args)
public static void runWithConsole()
{
NumberFormat money = NumberFormat.getCurrencyInstance();
Scanner key = new Scanner(System.in);
CarLoanMethods user;
int numberOfPayments = 0;
double remainingAmount, remainingAmountInCalculation;
user = new CarLoanMethods();
System.out.print("What is the model? ");
user.setModel(key.nextLine());
System.out.print("What is the loan amount? ");
user.setLoanAmount(key.nextInt());
remainingAmountInCalculation = user.getLoanAmount();
System.out.print("What is the interest rate? ");
user.setInterestRate(key.nextInt());
System.out.print("What is the monthly payment? ");
user.setMonthlyPayment(key.nextInt());
user.calculateEverything();
System.out.printf("\n%10s%35s", "Car model: ", user.getModel());
System.out.printf("\n%14s%31s", "Amount to pay: ", money.format(user.getTotalPrice()));
System.out.printf("\n%33s%12s", "Total interest that will be paid: ", money.format(user.getTotalInterest()));
System.out.printf("\n%19s%26s", "Number of payments: ", user.getNumberOfPayments());
}//runWithConsole()
}//CarLoanUser class
And the method class:
/**
* @author
*
*/
public class CarLoanMethods {
private String model;
private int loanAmount;
private int interestRate;
private int numberOfPayments = 0;
private double monthlyPayment;
private double interestTotal;
private double interest;
private double toBePaid;
public CarLoanMethods()
{
model = "Unknown";
loanAmount = 0;
interestRate = 0;
monthlyPayment = 0;
}//CarLoanMethods()
public CarLoanMethods(String userModel, int userLoan)
{
model = userModel;
loanAmount = userLoan;
interestRate = 0;
monthlyPayment = 0;
}//CarLoanMethods(String, int)
public CarLoanMethods(int userInternetRate, int userMonthlyPayment)
{
model = "Unknown";
loanAmount = 0;
interestRate = userInternetRate;
monthlyPayment = userMonthlyPayment;
}//CarLoanMethods(int, int)
public void setModel(String userModel)
{
model = userModel;
}//setModel(String)
public String getModel()
{
return model;
}//getModel()
public void setLoanAmount(int userLoan)
{
loanAmount = userLoan;
}//setLoanAmount(int)
public int getLoanAmount()
{
return loanAmount;
}//getLoanAmount()
public void setInterestRate(int userInterestRate)
{
interestRate = userInterestRate;
}//setInterestRate(int)
public int getInterestRate()
{
return interestRate;
}//getInterestRate()
public void setMonthlyPayment(double userMonthlyPayment)
{
monthlyPayment = userMonthlyPayment;
}//setMonthlyPayment(double)
public double getMonthlyPayment()
{
return monthlyPayment;
}//getMonthlyPayment()
public double getTotalInterest()
{
return interestTotal;
}//getTotalInterest()
public double getTotalPrice()
{
return interestTotal + loanAmount;
}//getTotalPrice
public int getNumberOfPayments()
{
return numberOfPayments;
}
public void calculateEverything()
{
double remainingAmountInCalculation = getMonthlyPayment();
while (remainingAmountInCalculation >= 0)
{
interest = remainingAmountInCalculation * ((interestRate / 100.0) / 12.0);
interest = Math.round(interest * 100.0) / 100.0;
remainingAmountInCalculation = (remainingAmountInCalculation + interest) - monthlyPayment;
interestTotal += interest;
++numberOfPayments;
}
}
}//CarLoanMethods
The program should work as I intended it to do. I know it need some work, but yeah.