简体   繁体   English

我想在 ubuntu 中编译 java 文件

[英]I want to compile java file in ubuntu

I want to compile java file in ubuntu.我想在 ubuntu 中编译 java 文件。

package com.amazonaws.services.s3 does not exist
cannot find symbol

But, this error occurs.但是,会发生此错误。 I made a lib folder in a project folder and put jar files in it.我在项目文件夹中创建了一个 lib 文件夹,并将 jar 文件放入其中。 In addition, there are Server.java files and ServerThread.java files in the Projects folder.此外,Projects文件夹中还有Server.java文件和ServerThread.java文件。 So I've been working on a project folder.所以我一直在处理一个项目文件夹。

javac -cp ".:./lib/*.jar" Server.java ServerThread.java

I did this.我这样做了。 However, an error occurs.但是,会发生错误。 I think the reason is that the jar file is not recognized.我认为原因是无法识别 jar 文件。 It worked well in Eclipse.它在 Eclipse 中运行良好。 How can I fix this?我怎样才能解决这个问题? Thank you.谢谢你。

May be that class belongs to a jar file which is distributed separately to AWS SDK.可能是 class 属于 jar 文件,该文件单独分发给 AWS SDK。 But usually To compile a java file in Ubuntu: open your terminal (In project folder) and type:但通常要在 Ubuntu 中编译 java 文件:打开终端(在项目文件夹中)并输入:

javac filename.java

To run the generated class file, use:要运行生成的 class 文件,请使用:

java filename

But to do this you need to have the Java JDK installed and configured in your computer.但要做到这一点,您需要在您的计算机中安装和配置 Java JDK。

Hope this helps..希望这可以帮助..

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

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