PDA

View Full Version : Can Java files from Ubuntu Eclipse work or can be exported to the Windows Eclipse?



Edgar117
March 3rd, 2013, 12:11 AM
Hi,

I starting Java programming at school and take a good guess, everyone uses Window$ :confused:

So we are practicing java for beginners in Eclipse (In Windows).

I want to know if I send my teacher my projects would the files run smoothly with out any problem??:guitar:

Thank You for your time

Tununias
March 3rd, 2013, 12:15 AM
Yes. The .java and .class files will all work on Windows.

QIII
March 3rd, 2013, 12:28 AM
Moved to Programming Talk

KdotJ
March 3rd, 2013, 02:14 AM
Java will work anywhere that Java is installed... no matter what operating system. The 'compiled' .class files that are created do not run on the native operating system... they run on a Java Virtual Machine (the JVM (http://en.wikipedia.org/wiki/Java_virtual_machine)).

r-senior
March 3rd, 2013, 02:23 AM
You probably also want to check you are using the same major version, e.g. Java 7.

tgalati4
March 3rd, 2013, 04:48 AM
Put in the comments block: Please don't ding me if this doesn't run on your Windows machine. It was programmed in a linux environment. Neckbeards for Freedom.

danniel
March 3rd, 2013, 02:25 PM
I want to know if I send my teacher my projects would the files run smoothly with out any problem??
Yes, everything should work fine.

Also remember that Linux and Windows use different end-of-line symbols. Most advanced editors (like Eclipse), don't have an issue with this, but if your teacher views the files in Notepad, then the text will look as one long line :)

As far as I can remember, you can force a certain end of line style in Eclipse, by going to Window > Preferences > General > Workspace > New text file line delimiter and choosing "Windows".

ofnuts
March 3rd, 2013, 07:14 PM
If you only send .java/.class files yes it should work (if you teacher is really picky you may have to convert java files to Windows end-of-line conventions with "todos", but if he is that picky change teachers... he doesn't know much).