简体   繁体   English

运行Java文件时出错

[英]error while running java files

I have two files like read.java and sufer_type.java . 我有两个文件,如read.javasufer_type.java The surfer_type.java needs some methods which are present in a .jar file. surfer_type.java需要.jar文件中存在的一些方法。 Before executing surfer_type.java I need to run read.java and use the data from read.java . 执行前surfer_type.java我需要运行read.java和使用数据read.java So I used the statement: 因此,我使用了以下语句:

read r=new read();

in surfer_type.java and I am compiling surfer_type.java like: surfer_type.java ,我正在像这样编译surfer_type.java

javac -classpath netcdfAll.jar surfer_type.java:

But I am getting an error: 但我收到一个错误:

surfer_netcdf.java:30: cannot find symbol
symbol  : class read
location: class surfer_netcdf
 read r = new read();
  ^
surfer_netcdf.java:30: cannot find symbol
symbol  : class read 
location: class surfer_netcdf
 read r = new read();

You are trying to instantiate a class read , which it is telling you does not exist (or rather, it cannot find). 您正在尝试实例化一个类read ,它告诉您不存在(或者找不到)。

Make sure the class exists and is properly imported in the class where you are trying to use it. 确保该类存在并且已正确导入到您要使用它的类中。

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

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