Results 1 to 8 of 8
  1. #1
    Drareeg is offline Member
    Join Date
    May 2010
    Posts
    11
    Rep Power
    0

    Default How to send a java file?

    Hello, I started learning Java about a week ago.
    I wonder how I can send my (small) programs I made in Java to someone else.

    I mean: when i was programming in C++ and when I built a file, there was automaticly a new .exe file added to the bin. So I could send that .exe file and then could open it on the other pc without having to do anything special.

    How can I do this in Java?

    kind regards

  2. #2
    [RaIdEn] is offline Senior Member
    Join Date
    Oct 2009
    Location
    California,US
    Posts
    201
    Rep Power
    10

    Default

    actually making a exe files into java is not a difficult process but it isnt as easy C or C++.

    if you want to send java application . try sending them the .java files , .class files are not the files to be sent

  3. #3
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    Acctually, if you want the other person to just run the app and not see the source, .class files are the ones to send.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  4. #4
    Drareeg is offline Member
    Join Date
    May 2010
    Posts
    11
    Rep Power
    0

    Default

    thx both for the fast answer, I don't know yet how to do it though.

    problems: if I send the .class ,how to open it on the other pc? (can't even run a .class on my own pc :s)
    if I send the .java ,I can only open it with text editors and Eclipse/codeblocks::

    tbh i think the .class is the correct answer (sounds the most logical), but then still, how to open it?

    i guess there isnt a way to just convert the .class (or .java) into a simple .exe file?

    thx :)

  5. #5
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    I never really delved into making .exe files from java apps, bom running the class file is what you do if you compile your programs in cmd:
    Java Code:
    java ClassName
    But since we do have jar files, I think it's the preffered way to do this (just personal opinion, your mileage mmay vary :D).
    Ever seen a dog chase its tail? Now that's an infinite loop.

  6. #6
    Drareeg is offline Member
    Join Date
    May 2010
    Posts
    11
    Rep Power
    0

    Default

    aha jar files that sounds good .. (I have to tell u I'm pretty nooby with cmd and jar files) but I guess jar files are axecutables and can be made from a .class :)
    if true
    how to make the .jar
    else
    I'll wait with this until I rly have something worth sharing :p

    thx for all help :)

  7. #7
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    Yeah, since pretty much everyone and their dog already has java on their computers, .jar files are just as practical as .exe. Most IDE's have a jar creation wizard, also have a look at this:
    Sun tutorial on jar files.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  8. #8
    Drareeg is offline Member
    Join Date
    May 2010
    Posts
    11
    Rep Power
    0

    Default

    aha this solves everything :)
    this thread can be locked
    thx a lot! :D

Similar Threads

  1. Send a XML file by POST to a server in php
    By rui.pereira in forum New To Java
    Replies: 0
    Last Post: 04-06-2010, 10:46 AM
  2. FTP send file to server
    By Marco_88 in forum Networking
    Replies: 5
    Last Post: 01-09-2010, 03:46 PM
  3. how to send mp3 file from server to client
    By Jigga008 in forum Networking
    Replies: 0
    Last Post: 12-01-2009, 12:02 PM
  4. how to send any file size using sockets
    By amjad.88 in forum Networking
    Replies: 12
    Last Post: 03-14-2009, 06:46 AM
  5. To send video file with JMF
    By eclipso in forum Networking
    Replies: 0
    Last Post: 06-12-2008, 08:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •