loadProps(props.getClass().getResourceAsStream(
loadProps(jEdit.class.getResourceAsStream(
	public static void main(String[] args)	{		// Parse command line		boolean endOpts = false;		boolean readOnly = false;		String userHome = System.getProperty("user.home");		String userDir = System.getProperty("user.dir");		usrProps = System.getProperty("user.home") + File.separator			+ ".jedit-props";		portFile = new File(userHome,".jedit-server");		desktopFile = new File(userHome,".jedit-desktop");		boolean showSplash = true;				for(int i = 0; i < args.length; i++)		{			String arg = args[i];			if(arg.startsWith("-") && !endOpts)			{				if(arg.equals("--"))					endOpts = true;				else if(arg.equals("-usage"))				{					version();					usage();					System.exit(1);				}				else if(arg.equals("-version"))				{					version();					System.exit(1);				}				else if(arg.equals("-nousrprops"))					usrProps = null;				else if(arg.equals("-noserver"))					portFile = null;				else if(arg.equals("-nodesktop"))					desktopFile = null;				else if(arg.equals("-nosplash"))					showSplash = false;				else if(arg.startsWith("-usrprops="))					usrProps = arg.substring(10);				else if(arg.startsWith("-portfile="))					portFile = new File(arg.substring(10));				else if(arg.startsWith("-desktopfile="))					desktopFile = new File(arg.substring(13));				else if(arg.equals("-readonly"))					readOnly = true;				else				{					System.err.println("Unknown option: "						+ arg);					usage();					System.exit(1);				}				args[i] = null;			}		}		// Try to connect to the server		if(portFile != null && portFile.exists())		{			try			{				BufferedReader in = new BufferedReader(					new FileReader(portFile));				Socket socket = new Socket("localhost",					Integer.parseInt(in.readLine()));				DataOutputStream out = new DataOutputStream(					socket.getOutputStream());				out.writeBytes(in.readLine());				out.write('\n');				if(readOnly)					out.writeBytes("-readonly\n");				out.writeBytes("-cwd=" + userDir + "\n");				boolean opened = false;				for(int i = 0; i < args.length; i++)				{					if(args[i] == null)						continue;					out.writeBytes(args[i]);					out.write('\n');					opened = true;				}				if(!opened)					out.write('\n');				socket.close();				in.close();				return;			}			catch(Exception e)			{				System.out.println("jEdit: stale port file deleted");				portFile.delete();			}		}		// Show the kool splash screen		SplashScreen splash = null;		if(showSplash)			splash = new SplashScreen();		// Create several objects		props = new Properties();		actionHash = new Hashtable();		modes = new Vector();		loader = new JarClassLoader();		plugins = new Vector();		buffers = new Vector();		views = new Vector();		recent = new Vector();		clipHistory = new Vector();				// Determine installation directory		jEditHome = System.getProperty("jedit.home");		if(jEditHome == null)		{			String classpath = System				.getProperty("java.class.path");			int index = classpath.toLowerCase()				.indexOf("jedit.jar");			int start = classpath.lastIndexOf(File				.pathSeparator,index) + 1;			if(index > start)			{				jEditHome = classpath.substring(start,					index - 1);			}			else				jEditHome = userDir;		}		jEditHome = jEditHome + File.separator;		// Load properties		try		{			loadProps(props.getClass().getResourceAsStream(				"/org/gjt/sp/jedit/jedit.props"),				jEditHome + "jedit.props");			loadProps(props.getClass().getResourceAsStream(				"/org/gjt/sp/jedit/jedit_gui.props"),jEditHome				+ "jedit_gui.props");			loadProps(props.getClass().getResourceAsStream(				"/org/gjt/sp/jedit/jedit_keys.props"),jEditHome				+ "jedit_keys.props");			loadProps(props.getClass().getResourceAsStream(				"/org/gjt/sp/jedit/jedit_tips.props"),jEditHome				+ "jedit_tips.props");			}		catch(Exception e)		{			System.err.println(">> ERROR LOADING SYSTEM PROPERTIES <<\n"				+ "One of the following property files could not be loaded:\n"				+ "- jedit.props\n"				+ "- jedit_gui.props\n"				+ "- jedit_keys.props\n"				+ "- jedit_tips.props\n"				+ "Try reinstalling jEdit.");			return;		}		// Load edit modes		addMode(new org.gjt.sp.jedit.mode.amstex());		addMode(new org.gjt.sp.jedit.mode.autoindent());		addMode(new org.gjt.sp.jedit.mode.bat());                addMode(new org.gjt.sp.jedit.mode.c());                addMode(new org.gjt.sp.jedit.mode.cc());		addMode(new org.gjt.sp.jedit.mode.html());		addMode(new org.gjt.sp.jedit.mode.java_mode());		addMode(new org.gjt.sp.jedit.mode.javascript());		addMode(new org.gjt.sp.jedit.mode.latex());		addMode(new org.gjt.sp.jedit.mode.makefile());		addMode(new org.gjt.sp.jedit.mode.sh());		addMode(new org.gjt.sp.jedit.mode.tex());		// Load actions		addAction(new org.gjt.sp.jedit.actions.about());		addAction(new org.gjt.sp.jedit.actions.block_comment());		addAction(new org.gjt.sp.jedit.actions.box_comment());		addAction(new org.gjt.sp.jedit.actions.browser_open_sel());		addAction(new org.gjt.sp.jedit.actions.browser_open_url());		addAction(new org.gjt.sp.jedit.actions.clear());		addAction(new org.gjt.sp.jedit.actions.clear_marker());		addAction(new org.gjt.sp.jedit.actions.close_file());		addAction(new org.gjt.sp.jedit.actions.close_view());		addAction(new org.gjt.sp.jedit.actions.compile());		addAction(new org.gjt.sp.jedit.actions.copy());		addAction(new org.gjt.sp.jedit.actions.cut());		addAction(new org.gjt.sp.jedit.actions.delete_end_line());		addAction(new org.gjt.sp.jedit.actions.delete_line());		addAction(new org.gjt.sp.jedit.actions.delete_no_indent());		addAction(new org.gjt.sp.jedit.actions.delete_paragraph());		addAction(new org.gjt.sp.jedit.actions.delete_start_line());		addAction(new org.gjt.sp.jedit.actions.exchange_anchor());		addAction(new org.gjt.sp.jedit.actions.execute());		addAction(new org.gjt.sp.jedit.actions.exit());		addAction(new org.gjt.sp.jedit.actions.expand_abbrev());		addAction(new org.gjt.sp.jedit.actions.find());		addAction(new org.gjt.sp.jedit.actions.find_next());		addAction(new org.gjt.sp.jedit.actions.find_selection());		addAction(new org.gjt.sp.jedit.actions.format());		addAction(new org.gjt.sp.jedit.actions.generate_text());		addAction(new org.gjt.sp.jedit.actions.goto_anchor());		addAction(new org.gjt.sp.jedit.actions.goto_end_indent());		addAction(new org.gjt.sp.jedit.actions.goto_error());		addAction(new org.gjt.sp.jedit.actions.goto_line());		addAction(new org.gjt.sp.jedit.actions.goto_marker());		addAction(new org.gjt.sp.jedit.actions.help());		addAction(new org.gjt.sp.jedit.actions.hypersearch());		addAction(new org.gjt.sp.jedit.actions.insert_date());		addAction(new org.gjt.sp.jedit.actions.join_lines());		addAction(new org.gjt.sp.jedit.actions.locate_bracket());		addAction(new org.gjt.sp.jedit.actions.make());		addAction(new org.gjt.sp.jedit.actions.new_file());		addAction(new org.gjt.sp.jedit.actions.new_view());		addAction(new org.gjt.sp.jedit.actions.next_error());		addAction(new org.gjt.sp.jedit.actions.next_paragraph());		addAction(new org.gjt.sp.jedit.actions.open_file());		addAction(new org.gjt.sp.jedit.actions.open_path());		addAction(new org.gjt.sp.jedit.actions.open_selection());		addAction(new org.gjt.sp.jedit.actions.open_url());		addAction(new org.gjt.sp.jedit.actions.options());		addAction(new org.gjt.sp.jedit.actions.paste());		addAction(new org.gjt.sp.jedit.actions.paste_predefined());		addAction(new org.gjt.sp.jedit.actions.paste_previous());		addAction(new org.gjt.sp.jedit.actions.pipe_selection());		addAction(new org.gjt.sp.jedit.actions.prev_error());		addAction(new org.gjt.sp.jedit.actions.prev_paragraph());		addAction(new org.gjt.sp.jedit.actions.print());		addAction(new org.gjt.sp.jedit.actions.redo());		addAction(new org.gjt.sp.jedit.actions.replace());		addAction(new org.gjt.sp.jedit.actions.replace_all());		addAction(new org.gjt.sp.jedit.actions.replace_in_selection());		addAction(new org.gjt.sp.jedit.actions.replace_next());		addAction(new org.gjt.sp.jedit.actions.save());		addAction(new org.gjt.sp.jedit.actions.save_all());		addAction(new org.gjt.sp.jedit.actions.save_as());		addAction(new org.gjt.sp.jedit.actions.save_url());		addAction(new org.gjt.sp.jedit.actions.scroll_line());		addAction(new org.gjt.sp.jedit.actions.select_all());		addAction(new org.gjt.sp.jedit.actions.select_anchor());		addAction(new org.gjt.sp.jedit.actions.select_block());		addAction(new org.gjt.sp.jedit.actions.select_buffer());		addAction(new org.gjt.sp.jedit.actions.select_line_range());		addAction(new org.gjt.sp.jedit.actions.select_mode());		addAction(new org.gjt.sp.jedit.actions.select_next_paragraph());		addAction(new org.gjt.sp.jedit.actions.select_no_indent());		addAction(new org.gjt.sp.jedit.actions.select_prev_paragraph());		addAction(new org.gjt.sp.jedit.actions.send());		addAction(new org.gjt.sp.jedit.actions.set_anchor());		addAction(new org.gjt.sp.jedit.actions.set_marker());		addAction(new org.gjt.sp.jedit.actions.shift_left());		addAction(new org.gjt.sp.jedit.actions.shift_right());		addAction(new org.gjt.sp.jedit.actions.tab());		addAction(new org.gjt.sp.jedit.actions.to_lower());		addAction(new org.gjt.sp.jedit.actions.to_upper());		addAction(new org.gjt.sp.jedit.actions.uncomment());		addAction(new org.gjt.sp.jedit.actions.undo());		addAction(new org.gjt.sp.jedit.actions.untab());		addAction(new org.gjt.sp.jedit.actions.wing_comment());		addAction(new org.gjt.sp.jedit.actions.word_count());		// Load plugins		loadPlugins(jEditHome + "jars");		loadPlugins(System.getProperty("user.home") + File.separator			+ ".jedit-jars");		// Load user properties		props = new Properties(props);		if(usrProps != null)		{			try			{				loadProps(null,USER_PROPS);			}			catch(FileNotFoundException fnf)			{			}			catch(IOException e)			{				System.err.println("Error while loading user"					+ " properties:");				e.printStackTrace();			}		}		propertiesChanged();		// Set look and feel		String lf = props.getProperty("lf");		try		{			if(lf != null)				UIManager.setLookAndFeel(lf);		}		catch(Exception e)		{			System.err.println("Error loading L&F!");			e.printStackTrace();		}				// Load recent file list		for(int i = 0; i < maxRecent; i++)		{			String recentFile = getProperty("recent." + i);			if(recentFile != null)				recent.addElement(recentFile);		}		// Load clip history		for(int i = 0; i < maxClipHistory; i++)		{			String clip = getProperty("clipHistory." + i);			if(clip != null)				clipHistory.addElement(clip);		}		// Load files specified on the command line		Buffer buffer = null;		for(int i = 0; i < args.length; i++)		{			if(args[i] == null)				continue;			buffer = openFile(null,userDir,args[i],readOnly,false);		}		if(buffer == null)		{			if("on".equals(getProperty("saveDesktop"))				&& desktopFile != null && desktopFile.exists())			{				try				{					BufferedReader in = new BufferedReader(						new FileReader(desktopFile));					String line;					while((line = in.readLine()) != null)					{						Buffer b = parseDesktopEntry(line);						if(b != null)							buffer = b;					}					in.close();				}				catch(FileNotFoundException fnf)				{				}				catch(IOException io)				{					System.err.println("Error while loading desktop:");					io.printStackTrace();				}			}		}		if(buffer == null)			buffer = newFile(null);		// Create the view		newView(buffer);		// Dispose of the splash screen		if(splash != null)			splash.dispose();	}