Sending Java Files by Email: ZIP to Compile & Run

  • Context: Java 
  • Thread starter Thread starter *best&sweetest*
  • Start date Start date
  • Tags Tags
    files Java
Click For Summary
SUMMARY

The discussion centers on the challenges of sending Java files via email in a zipped format, specifically when using jGrasp. Users report that programs function correctly in an unzipped folder but fail to compile when zipped, with errors indicating that symbols cannot be found. A solution proposed includes enabling the "Save full path info" option during zipping, as well as considering packaging the files into a .jar file for easier distribution and execution.

PREREQUISITES
  • Understanding of Java programming and file structure
  • Familiarity with jGrasp IDE
  • Knowledge of zipping files and compression tools
  • Basic concepts of Java Archive (.jar) files
NEXT STEPS
  • Learn how to enable "Save full path info" in your zipping tool
  • Research how to create and use .jar files for Java applications
  • Explore troubleshooting compilation errors in Java
  • Investigate best practices for sharing Java projects via email
USEFUL FOR

Java developers, educators, and anyone involved in sharing Java projects who need to ensure that their code compiles and runs correctly after being sent via email.

*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?
 

Similar threads

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