Sending Java Files by Email: ZIP to Compile & Run

  • Java
  • Thread starter *best&sweetest*
  • Start date
  • Tags
    files Java
In summary, the speaker is having trouble compiling and running their Java files when they are zipped and sent by email. They mention that the files work fine when unzipped, but when zipped, the compilation fails and they receive an error message saying "cannot find symbol." The speaker is seeking help on how to properly zip and send the files so that they can be compiled and run by others. A potential solution is suggested to turn on "Save full path info" when zipping, or to use a .jar file instead.
  • #1
*best&sweetest*
36
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
  • #2
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.
 
  • #3
Why not just put them in a .jar?
 

1. Can I send any type of Java file through email?

Yes, you can send any type of Java file through email, including .java, .class, and .jar files. However, it is recommended to compress the files into a ZIP format before sending to ensure efficient and error-free transfer.

2. How do I compress Java files into a ZIP format?

To compress Java files into a ZIP format, you can use a file compression software such as WinZip or 7-Zip. Simply select the Java files you want to compress, right-click and choose the option to "Add to ZIP file". This will create a ZIP file containing all the selected Java files.

3. Can I send multiple Java files in one email?

Yes, you can send multiple Java files in one email by compressing them into a single ZIP file. This is a more efficient way of sending multiple files as it reduces the file size and ensures all files are transferred together.

4. How can the recipient run the Java files sent through email?

The recipient can run the Java files by first extracting the ZIP file using a file extraction software. Once the files are extracted, they can be compiled and run using a Java compiler, such as javac, and a Java virtual machine, such as java.

5. Are there any limitations to sending Java files through email?

There are no inherent limitations to sending Java files through email. However, some email providers may have file size limits, so it is recommended to compress the files into a ZIP format to ensure successful delivery. Additionally, make sure to check the recipient's email settings to ensure they can receive Java files.

Similar threads

  • Programming and Computer Science
Replies
9
Views
852
  • Programming and Computer Science
Replies
2
Views
641
  • Programming and Computer Science
Replies
3
Views
668
  • Programming and Computer Science
Replies
3
Views
4K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
7
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
2
Views
354
Back
Top