Jump to content

random error


ashtonr12

Recommended Posts

i havnt even touched this class but when i opened eclipse today minecraft wont start saying theres an error with the start.java

 

theres tonees or red error lines all over this package :o

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;

import net.minecraft.client.Minecraft;

public class Start
{
    public static void main(String[] args)
    {
        try
        {
            Field f = Minecraft.class.getDeclaredField("minecraftDir");
            Field.setAccessible(new Field[] { f }, true);
            f.set(null, new File("."));
        }
        catch (Exception e)
        {
            e.printStackTrace();
            return;
        }

        if (args.length != 2)
        {
            Minecraft.main(args);
        }
        else
        {
            try
            {
                String parameters = "http://login.minecraft.net/?user=" + URLEncoder.encode(args[0], "UTF-8") +
                        "&password=" + URLEncoder.encode(args[1], "UTF-8") +
                        "&version=" + 13;
                String result = openUrl(parameters);

                if (result == null)
                {
                    System.out.println("Can't connect to minecraft.net");
                    return;
                }

                if (!result.contains(":"))
                {
                    System.out.println("Login Failed: " + result);
                    return;
                }

                String[] values = result.split(":");
                Minecraft.main(new String[] {values[2].trim(), values[3].trim()});
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
    }

    private static String openUrl(String addr)
    {
        try
        {
            URL url = new URL(addr);
            java.io.InputStream is;
            is = url.openConnection().getInputStream();
            java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(is));
            String buf = "";
            String line = null;

            while ((line = reader.readLine()) != null)
            {
                buf += "\n" + line;
            }

            reader.close();
            return buf;
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }

        return null;
    }
}

 

here is the error code

 

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
String cannot be resolved to a type
Field cannot be resolved to a type
Class<Minecraft> cannot be resolved to a type
Field cannot be resolved
Field cannot be resolved to a type
File cannot be resolved to a type
Exception cannot be resolved to a type
String cannot be resolved to a type
URLEncoder cannot be resolved
URLEncoder cannot be resolved
String cannot be resolved to a type
System cannot be resolved
System cannot be resolved
String cannot be resolved to a type
String cannot be resolved to a type
Exception cannot be resolved to a type

at Start.main(Start.java:13)

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.