• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

question about java........

Semidevil

Diamond Member
ok, so I'm just starting to learn Java. I am learning to write a java program regarding temperature where if you enter a number, it will convert it to Celcius for you.

Ok, so lets say I get it done......I'm really proud of it, and I want to send it to my friend......

obviously, once the program is done, it turns out to be a .java program. Can I turn it to some kind of program that I can distribute to a friend(maybe .exe file) or something??

I don't know.......
 
You could give him the .class file if he has a java interpreter.

I know ol' MS Visual J++ allowed you to build .exe files, but I don't know of any IDEs or compilers that do that.

Anyone else?

-geoff
 
Originally posted by: ffmcobalt
You've got to compile the .java file. 🙂

nik (forgot to put the smile face in)


right.. but that still wont give you an executable file will it? i know for VB or C in visual studios, there is actually a compile to executable command that you can do.. i'm not sure if any java compilers (i've only used blueJ) do anythign like that.
 
Originally posted by: ggavinmoss
You could give him the .class file if he has a java interpreter.

I know ol' MS Visual J++ allowed you to build .exe files, but I don't know of any IDEs or compilers that do that.

Anyone else?

-geoff

hmm.........well, I want to be able to send programs that I made to my friends so they can play w/ it. None of my friends know java.....

but abuot the C++/VB thing. Are those the only things that will work? how far apart are Java and C++. Are they the same???

all I know about C++ is that they have C-in>/C-out> statments.... that's it........🙁

Descartes: the compiler that I have is the SDK 4.01 at sun.java.com. What is a PE file?? and that link, am I d/loading the compiler? what are those files??

 
but abuot the C++/VB thing. Are those the only things that will work? how far apart are Java and C++. Are they the same???

If they were they same, there wouldn't be two languages 🙂 They share some similar syntactical elements, but they are completely different languages, in too many ways to note in a short post.

the compiler that I have is the SDK 4.01 at sun.java.com. What is a PE file?? and that link, am I d/loading the compiler? what are those files??

You still need the MS Java SDK as I noted. A PE file is a portable executable, the file format used on win32 systems for executables. Just go to the link, all you need to know is there.
 
ok, like I said, I'm extremely new to Java.....

so I d/loaded teh ms sdk.....now what? Did I d/load another compiler??

ok, so let's say I created a program on textpad....now what do I do to make it an *exe(or any other form) so I can distribute it??
 
As xospec1alk said, you still need a JRE to run an executable wrapper for a Java application. It simply doesn't make sense to go that route.

Just package your class files up into a JAR, with a Manifest file that specifies the Main-Class. Any friends who want to use your application will need a JRE.

You might want to check into something called Java Web Start.
 
I may be missing something here, but why not write an html file and give that to him with the supporting files? (the compiled .class file)
 
Originally posted by: 911paramedic
I may be missing something here, but why not write an html file and give that to him with the supporting files? (the compiled .class file)
yeah if he drops the code in as a java applet he can call it from an HTML file...

 
Also assuming he doesn't use any of the latest features of the SDK, since most Web browsers do not include everything you can run in an application. Unless of course, the nasty (crash, crash) java plug in is used. Probably more an issue with more complicated things.


Java is still (kind of) an interpreted language, unless c++ etc.. which compiles right into code. If they hadn't done that ( I wish they hadn't sometimes), your friends wouldn't have to download 30 + MB just to run your little program. C++ and java may share quite a bit in the way of syntax, but c++ is basically more primitive and demands more from the programmer to not do stupid things.

I think Visual Cafe (I believe you have to pay $ for it), or something like that allows you to create dll's out of java programs, and you can dll the entire java runtime (lol -- few megabytes there) and your progie, in which case no runtime is needed.
 
Back
Top