Java Sending Java Files by Email: ZIP to Compile & Run

  • Thread starter Thread starter *best&sweetest*
  • Start date Start date
  • Tags Tags
    files Java
Click For Summary
When zipping Java files for email, issues arise if the programs fail to compile after being unzipped. The main problem is that the Java compiler cannot find user-defined classes or components, leading to "cannot find symbol" errors. To resolve this, ensure that the "Save full path info" option is enabled when creating the zip file. Alternatively, consider packaging the files into a .jar file, which can simplify distribution and maintain the necessary structure for the Java programs to compile and run correctly after being received.
*best&sweetest*
Messages
36
Reaction score
0
I have to put a bunch of Java files (written in jGrasp) into one zipped folder and send it by email. The problem is that all programs work perfectly well when they are in an unzipped folder, but, when I convert folder into a ziped one, programs don't work. For example, I have user defined class, JPanel, and a program with main method, and if I try to compile program in zipped folder it doesn't recognize the panel name and the class name. It says "cannot find symbol." Class,panel, and program are in the same folder and it still doesn't work.

If you understand what I am talking about, please help me to find out how to zip everything and send it so that it compiles and runs when other people receive it.
Thank you!
 
Technology news on Phys.org
You don't really mean "try to compile program in zipped folder" do you? You mean that after you unzip the file, the compilation on the unzipped folder(s) fails?

If the latter, be sure to turn on "Save full path info" when you zip.
 
Why not just put them in a .jar?
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 0 ·
Replies
0
Views
618
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
1K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 29 ·
Replies
29
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K