如何在具有不同(.java)文件的netbeans上运行项目

时间:2023-01-17 11:23:32

I just got one project of java online,but this project having multiple .java files which are use by one another,so how to run this project using netbeans

我刚刚有一个java在线项目,但这个项目有多个.java文件,彼此使用,所以如何使用netbeans运行这个项目

2 个解决方案

#1


1  

First create a new package in your project and name it however you want. 2. Move your classes into the package you have created. 3. Change the name of your package inside the class files e.g. from"package test;" to "package newTest" 4.Then save all and run the project as one application

首先在项目中创建一个新包,然后根据需要为其命名。 2.将您的类移动到您创建的包中。 3.在类文件中更改包的名称,例如来自“包装测试”; “打包newTest”4.然后保存所有并将项目作为一个应用程序运行

#2


0  

you need to have all the files on one folder / package , than search for your main class and compile it

你需要拥有一个文件夹/包上的所有文件,而不是搜索你的主类并编译它

#1


1  

First create a new package in your project and name it however you want. 2. Move your classes into the package you have created. 3. Change the name of your package inside the class files e.g. from"package test;" to "package newTest" 4.Then save all and run the project as one application

首先在项目中创建一个新包,然后根据需要为其命名。 2.将您的类移动到您创建的包中。 3.在类文件中更改包的名称,例如来自“包装测试”; “打包newTest”4.然后保存所有并将项目作为一个应用程序运行

#2


0  

you need to have all the files on one folder / package , than search for your main class and compile it

你需要拥有一个文件夹/包上的所有文件,而不是搜索你的主类并编译它