Java Problem about .java file and email

  • Thread starter Thread starter kant
  • Start date Start date
  • Tags Tags
    Email File
AI Thread Summary
To send a .java file as an attachment in an email and ensure it opens directly in a Java compiler, several technical considerations must be addressed. The recipient's email client may display the code in plain text rather than as an attachment, which is a common issue. To resolve this, the sender cannot enforce the recipient's settings or preferences, as the recipient must configure their email client to recognize and handle .java files appropriately. Additionally, the web server may need to be set with the correct MIME type for Java files. Security settings in email clients may also prevent automatic invocation of a Java compiler due to potential risks associated with executing Java code. A suggestion was made to send the file as a compiled JAR instead, which may be more compatible with the recipient's setup. Ultimately, the sender has limited control over how the recipient's system processes the attachment.
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?
 
Technology 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
 
Maybe he wants you to send it as a compiled jar?
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top