You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Eclipse生成Javadoc时出现Error=193错误的解决求助

生成Javadoc HTML文件时遭遇Error 193错误

我在完成作业时,为编写的类生成Javadoc HTML文件遇到了问题。操作步骤如下:

  • 点击Project > Generate Java Doc
  • Javadoc命令自动填充为C:\Users\Evanl\workspace\CSC - Car Class\bin\Main\Car.class
  • 点击Next,命名文档为“Car javadoc”
  • 点击Finish后弹出Error 193错误

我已经尝试过谷歌和油管搜索这个错误,但没找到相关解决指南。以下是我的代码:

CarMain类

package Main;

public class CarMain {
    public static void main(String[] args) {
        Car car1 = new Car("Honda", "Civic", "Black", 2020);

        System.out.println(car1.toString() +"\n"+car1.ageOfCar()+"\n");

        // TODO (Optional)
        // Create another Car object named car2 and input your own values :)
        // And then output its values like I did in line 5
        // This is completely optional
        
        Car myCar = new Car("Jeep", "Wrangler", "Black", 2023);
        System.out.println(myCar.toString() +"\n"+myCar.ageOfCar()+"\n");
    }
}

Car类

package Main;

/**
 * @author Evan Cammack
 * @version 1.0
 * created on 2/15/2023
 * this is a template for a software car object
*/
import java.util.Calendar;
public class Car {


  //private fields
  private String make;
  private String model;
  private String color;
  private int year;
  private double mileage;

  //default constructor sets all fields to default blank values
  public Car(){
    make = "";
    model = "";
    color = "";
    year = 0;
    mileage = 0;
  }
 
  //custom constructor
  //"this" refers to current object

  /**
   * @param make String parameter representing make of car
   * @param model String parameter representing model of car
   * @param color String parameter representing color of car
   * @param year int parameter representing year of car
   * @throws IllegalArgumentException if year equals "0000"
  */

  public Car(String make, String model, String color, int year){
    this.make = make;
    this.model = model;
    this.color = color;
    if (year <= 0000)
      throw new IllegalArgumentException();
    this.year = year;
    mileage = 0;
  }

  //getters
  /**
   * @return make - the make of the car
  */
  public String getMake(){
    return this.make;
  }
  /**
   * @return model - the model of the car
  */
  public String getModel(){
    return this.model;
  }
  /**
   * @return color - the color of the car
  */
  public String getColor(){
    return this.color;
  }
  /**
   * @return year - the year of the car
  */
  public int getYear(){
    return this.year;
  }

  //setters
  /**
   * @param make changes to the make of the car to given input String
  */
  public void setMake(String make){
    this.make = make;
  }
  /**
   * @param make changes to the model of the car to given input String
  */
  public void setModel(String model){
    this.model = model;
  }
  /**
   * @param make changes to the color of the car to given input String
  */
  public void setColor(String color){
    this.color = color;
  }
  /**
   * @param make changes to the year of the car to given input String
  */
  public void setYear(int year){
    this.year = year;
  }

  /**
   * @return ageOfCar - how old the car is
   */
  public String ageOfCar() {
    Calendar cal = Calendar.getInstance();
    int ageOfCar = cal.get(Calendar.YEAR) - this.year;
    return "This car is "+ageOfCar+" years old.";
  }
  
  /**
   * @return make, model, color, year - returns make, model, color, and year in a string
   */
  public String toString() {
    return "Make: " +this.make+" Model: "+this.model+" Color: "+this.color+" Year: "+this.year;
  }
  
}

内容的提问来源于stack exchange,提问作者Evan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 23:50:34