Problem about .java file and email

  • Context: Java 
  • Thread starter Thread starter kant
  • Start date Start date
  • Tags Tags
    Email File
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 4K views
kant
Messages
388
Reaction score
0
I am trying to send a .java file as an attachment in my email. the problem is that when guy who received my email open his email, all he see s is the java code in plan text format. I want the person who received my email to open the attachment, and automatically invoke his java compiler, and my java code in his java compiler screen. what do i need in order to do this?
 
Physics news on Phys.org
You could always have your friend copy the "text" (your code) from the e-mail, and then open the program notepad (or another text editor), paste the text, and then save it as a .java file.
 
mattmns said:
You could always have your friend copy the "text" (your code) from the e-mail, and then open the program notepad (or another text editor), paste the text, and then save it as a .java file.

this "guy" is actually my professor. He doesn t want to copy and paste, because he said so in class.
 
kant said:
I am trying to send a .java file as an attachment in my email. the problem is that when guy who received my email open his email, all he see s is the java code in plan text format. I want the person who received my email to open the attachment, and automatically invoke his java compiler, and my java code in his java compiler screen. what do i need in order to do this?

The webserver might have to be set with a mime type for java.

In addition, the recipient's webbrowser might have to be configured to handle specific filetypes with specific programs.

Some email-clients might regard the ability to invoke a java compiler like that as a security violation. (Java programs are more dangerous than java applets.)

As far as I can tell, there is nothing that you, the sender, can do alone.

kant said:
this "guy" is actually my professor. He doesn t want to copy and paste, because he said so in class.
Has your professor been successful with submissions from other students but not from you?
 
There's no way for YOU, the sender, to mandate that the receiver open your .java file with a Java compiler. Only the RECEIVER can set such preferences.

- Warren