Results 1 to 5 of 5

Thread: Little Help Plz

  1. #1
    Hellz is offline Member
    Join Date
    Mar 2008
    Posts
    1
    Rep Power
    0

    Exclamation Little Help Plz

    Can anyone tell me how to compile a .java file to a .class file with errors.. i have some problems. I know how to compile a .java file to a .class file but i need to compile one more .java to .class but i cant because i get some errors. I know the code is right but i don't know why i get the error. So i kindly ask... Does anyone know how to compile the .java to .class with the errors. Or some kind of program to do it or something. Your help is very appreciated. Thank you.

  2. #2
    Vicious is offline Member
    Join Date
    Mar 2008
    Posts
    2
    Rep Power
    0

    Default

    you can put all of your javaFiles(*.java) in one folder. we assume that whose name is aaa.then you can get all corresponding classFiles useing command: javac aaa\*.java.
    Sorry,my english is poor.I give this example:
    C:> dir
    aaa\
    C:> dir aaa
    1.java 2.java 3.java 4.java ....
    C:> javac aaa\*.java
    C:> dir aaa
    1.class 2.class 3.class 4.class ...
    1.java 2.java 3.java 4.java ...
    I hope you can solve your problem. ^-^

  3. #3
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    8

    Default

    I'm not sure if you can compile with errors. Is it a large program? If not, maybe you could paste the code here and we could take a look to see if we can fix the errors for you.
    Did this post help you? Please me! :cool:

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by DonCash View Post
    I'm not sure if you can compile with errors. Is it a large program? If not, maybe you could paste the code here and we could take a look to see if we can fix the errors for you.
    Yep, and who need a code with errors. :confused:

    If you have any question let me know others here. Lots of people are ready here.

  5. #5
    Bluefox815 is offline Member
    Join Date
    Feb 2008
    Location
    Oregon, USA
    Posts
    49
    Rep Power
    0

    Default

    You can't compile with errors because when there's an error, the compiler couldn't possibly know what to convert it to, it's like trying to compile this:
    Java Code:
    public void getInt() {
    return number;
    }
    you can't return an int when the return type is void, so an error is generated because there is nothing the compiler can do. I'd suggest fixing the errors because, no offense, the code is obviously wrong, unless you are using a deprecated API. Otherwise, like DonCash said, you can post your code and we'll fix it if we can.
    Last edited by Bluefox815; 04-01-2008 at 02:37 AM.

Posting Permissions

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