Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • Author

as in restart eclipse or reinstall all of it?

Use examples, i have aspergers.

Examples make sense to me.

  • Author

can you tell me how i fudged up so i can avoid it next time?

Use examples, i have aspergers.

Examples make sense to me.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.