Exception in thread "main" java.lang.OutOfMemoryError [问题点数:50分,结帖人fanwanping]

Bbs2
本版专家分:109
结帖率 100%
Bbs2
本版专家分:109
Bbs5
本版专家分:2274
Bbs4
本版专家分:1807
main" java.lang.NoSuchMethodError:main">Exception in thread "main" java.lang.NoSuchMethodError:main
rn//用冒泡法进行排序rnrnpublic class paixvrnrnint shuzhi[]=1,25,84,69,325,68,42;rnint num=0; rnint temp=0;rnrnpublic void <em>main</em>(String arg[])rnrnfor (num=1;numshuzhi[num+1]) rn rn rn temp=shuzhi[num];rn shuzhi[num]=shuzhi[num+1];rn shuzhi[num+1]=temp;rn rn rnfor (num=1;num java.lang.NoSuchMethodError:<em>main</em>
main"">java.lang.NoSuchMethodError: main Exception in thread "main"
[code=Java]rnpublic class Test rnrn /**rn * @param argsrn */rn public static void <em>main</em>(String[] args) rn Date date = new Date();rn String dates = String.format(null, "%tF", date);rn System.out.println(dates);rn rnrnrn[/code]rn这是程序。我也从网上查了好久。都说是没有<em>main</em>方法。rn还是没解决 。请教大虾了。。rn什么原因?怎么改?
main" java.lang.NullPointerException">Exception in thread "main" java.lang.NullPointerException
希望高手指点
exception in thread main???
java.lang.NoClassDefFoundErrorrn请问是怎么回事?多谢!
main" java.lang.NoClassDefFoundError:">Exception in thread "main" java.lang.NoClassDefFoundError:
编译通过rn在执行时出现如下错误是什么原因:rnException in <em>thread</em> "<em>main</em>" java.lang.NoClassDefFoundError:rnrnrn
main"">java.lang.NoClassDefFoundError: Exception in thread "main"
刚开始学习并发 遇到一个问题,请高手帮忙解决rnrn//LiftOff.javarn public class LiftOff implements Runnablern protected int countDown=10;rn public static int taskCount=0;rn private final int id =taskCount++;rn public LiftOff()rn public LiftOff(int countDown)rn this.countDown=countDown;rn rn rn public String status()rn return "#"+id+"("+rn (countDown>0?countDown:"LiftOff!")+"), ";rn rn public void run()rn while(countDown0)rn System.out.println(status());rn Thread.yield();rn rn rn rn rnrn//MainThread.javarnpublic class MainThread rnrn public static void <em>main</em>(String[] args) rn // TODO 自动生成方法存根rn rn LiftOff launch=new LiftOff();rn launch.run();rn rn rnrnrn1在eclipse中运行输出java.lang.NoClassDefFoundError ,同一包中的其他程序运行无异常rn2使用命令编译运行无误rn怎么解决rnrnrn
main" org.springframework.beans.factory.BeanCreationExcep">Exception in thread "main" org.springframework.beans.factory.BeanCreationExcep
Exception in <em>thread</em> "<em>main</em>" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [D:\work\travl\target\classes\spring-mybatis.xml]: Initialization of bean failed; nested <em>exception</em> is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested <em>exception</em> is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/hbnu/travl/mapping/*.xml]: class path resource [com/hbnu/travl/mapping/] cannot be resolved to URL because it does not existrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:681)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at com.hbnu.travl.control.TestControl.<em>main</em>(TestControl.java:44)rnCaused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested <em>exception</em> is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/hbnu/travl/mapping/*.xml]: class path resource [com/hbnu/travl/mapping/] cannot be resolved to URL because it does not existrn at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:479)rn at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:511)rn at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:505)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1502)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1461)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1197)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)rn ... 11 morernCaused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:com/hbnu/travl/mapping/*.xml]: class path resource [com/hbnu/travl/mapping/] cannot be resolved to URL because it does not existrn at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:140)rn at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:430)rn at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:403)rn at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:181)rn at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:459)rn ... 17 morernrnrnrnrnrnrnrnrnrnrnrnrnrn请问大神怎么回事rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rnrnrn
main"">Exception in thread "main"
JAVA新手,写了一个计算复数加减乘除的程序,没有语法错误,却出现了运行错误,找不出相应的错误,请指教!rn以下是代码:rnclass Complexrnrn // a为实部,b为虚部rn private double a;rn private double b;rn rn public Complex()rn rn rn rn public Complex(double a, double b)rn rn this.a = a;rn this.b = b;rn rn rn // 设置相关属性rn public void setA(double a)rn rn this.a = a;rn rn public void setB(double b)rn rn this.b = b;rn rn rn // 得到相关属性rn public double getA()rn rn return a;rn rn public double getB()rn rn return b;rn rn rn // 重写Object类的toString()方法rn public String toString()rn rn return "(" + a + " + " + b + "i)";rn rnrnpublic class ComplexTestrnrn private static Complex c;rn public static Complex add(Complex c1, Complex c2)rn rn c = null;rn c.setA(c1.getA() + c2.getA());rn c.setB(c1.getB() + c2.getB());rn return c;rn rn public static Complex subtract(Complex c1, Complex c2)rn rn c = null;rn c.setA(c1.getA() - c2.getA());rn c.setB(c1.getB() - c2.getB());rn return c;rn rn public static Complex multiply(Complex c1, Complex c2)rn rn c = null;rn c.setA(c1.getA() * c2.getA() - c1.getB() * c2.getB());rn c.setB(c1.getB() * c2.getA() + c1.getA() * c2.getB());rn return c;rn rn public static Complex divide(Complex c1, Complex c2)rn rn c = null;rn c.setA((c1.getA() * c2.getA() + c1.getB() * c2.getB()) /rn (c2.getA() * c2.getA() + c2.getB() * c2.getB()));rn c.setB((c1.getB() * c2.getA() - c1.getA() * c2.getB()) /rn (c2.getA() * c2.getA() + c2.getB() * c2.getB()));rn return c;rn rn public static void <em>main</em>(String args[])rn rn Complex c1 = new Complex(1, 2);rn Complex c2 = new Complex(3, 4);rn System.out.println(add(c1, c2));rn System.out.println(subtract(c1, c2));rn System.out.println(multiply(c1, c2));rn System.out.println(divide(c1, c2));rn rn rnrn
main" java.lang.UnsatisfiedLinkError">Exception in thread "main" java.lang.UnsatisfiedLinkError
Exception in <em>thread</em> "<em>main</em>" java.lang.UnsatisfiedLinkError: com.sun.midp.<em>main</em>.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;rn at com.sun.midp.<em>main</em>.Configuration.getProperty0(Native Method)rn at com.sun.midp.<em>main</em>.Configuration.getProperty(Configuration.java:32)rn at com.sun.midp.lcdui.Resource.(Resource.java:30)rn at com.sun.midp.<em>main</em>.Main.initSystemLabels(Main.java:686)rn at com.sun.midp.<em>main</em>.Main.<em>main</em>(Main.java:103)rnthanks!!!!help me please
main" java.lang.Error">Exception in thread "main" java.lang.Error
package com.dlhs;nclass Person()n n public void setName(String name)n this.name=name;n n public void setAge(int age)n this.age=age;n n public return String getName()n return name;n n public return int getAge()n return age;n nnnclass Student extends Person()n n public return String getSchool()n return school;n n public void setSchool(String school)n this.school =school;n nnpublic class Testn public static void <em>main</em>(String args[])n public String school;n public String name;n public int age;n Student student =new Student();n student.setName("john");n student.setAge(18);n student.setSchool("SCH");n System.out.println(student.getName());n System.out.println(student.getAge());n System.out.println(student.getSchool());nnn
main"java.lang.ArrayIndexOutofBoundsException">Exception in thread "main"java.lang.ArrayIndexOutofBoundsException
这是我写的一个小拼图游戏 就是把0-8按顺序拼好 可是在DOS运行提示我14和34行Exception in <em>thread</em> "<em>main</em>"java.lang.ArrayIndexOutofBoundsException 求指点!不胜感激!rnrnimport javax.swing.*;rnimport java.awt.*;rnimport java.awt.event.*;rnimport java.util.ArrayList;rnrnpublic class SlidingPuzzle implements MouseListenerrn public static int level=3;rn public PuzzleTile[][] XueButtonArray= new PuzzleTile[level-1][level-1];rn JFrame Xueframe= new JFrame();rn JPanel Xuepanel= new JPanel();rn rn public static void <em>main</em>(String[] args)rn SlidingPuzzle XueGame= new SlidingPuzzle();rn [color=#FF0000]XueGame.start();[/color]rn rn rn public void start()rn Xueframe.setTitle("Numeric Slding Puzzle");rn Container XueContainer=Xueframe.getContentPane();rn XueContainer.setLayout(new GridLayout(level,level,1,1));rn rn int[][] a=new int[level][level];rn a[0][0]=(int)(Math.random()*(level*level));rn this.XueButtonArray[0][0]=new PuzzleTile(a[0][0]);rn this.XueButtonArray[0][0].setTileNumber(""+a[0][0]);rn this.XueButtonArray[0][0].addMouseListener(this); rn XueContainer.add(XueButtonArray[0][0]);rn for(int i=0;i
main" java.lang.NoSuchMethodError ?">Exception in thread "main" java.lang.NoSuchMethodError ?
[size=16px]不是没有<em>main</em>函数的问题。环境变量也设置成功。[/size]rn代码如下rn[code="java"]import com.sun.syndication.feed.synd.SyndFeed;rnrnimport com.sun.syndication.io.SyndFeedInput;rnrnimport com.sun.syndication.io.XmlReader;rnimport java.net.*;rnpublic class Writer rn public Writer()rn System.out.println("Start...");rn String str ="http://wyzwz527.blogbus.com/index.rdf";rn boolean ok = false;rn try rn URL feedUrl = new URL(str);rn SyndFeedInput input = new SyndFeedInput();rn SyndFeed feed = input.build(new XmlReader(feedUrl));rn System.out.println(feed);rn ok = true;rn rn catch (Exception ex) rn ex.printStackTrace();rn System.out.println("ERROR: "+ex.getMessage());rn rn if (!ok) rn System.out.println();rn System.out.println("FeedReader reads and prints any RSS/Atom feed type.");rn System.out.println("The first parameter must be the URL of the feed to read.");rn System.out.println();rn rn rn rn public static void <em>main</em>(String[] args)rn new Writer();rnrn rnrnrn[/code]rn没任何语法错误,就是编译之后报错rnStart...rnException in <em>thread</em> "<em>main</em>" java.lang.NoSuchMethodError: com.sun.syndication.io.impl.BaseWireFeedParser.(Ljava/lang/String;)Vrn at com.sun.syndication.io.impl.OPML10Parser.(OPML10Parser.java:46)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at java.lang.Class.newInstance0(Class.java:355)rn at java.lang.Class.newInstance(Class.java:308)rn at com.sun.syndication.io.impl.PluginManager.loadPlugins(PluginManager.java:90)rn at com.sun.syndication.io.impl.PluginManager.(PluginManager.java:55)rn at com.sun.syndication.io.impl.PluginManager.(PluginManager.java:46)rn at com.sun.syndication.io.impl.FeedParsers.(FeedParsers.java:53)rn at com.sun.syndication.io.WireFeedInput.getFeedParsers(WireFeedInput.java:64)rn at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:273)rn at com.sun.syndication.io.WireFeedInput.build(WireFeedInput.java:195)rn at com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:123)rn at Writer.(Writer.java:15)rn at Writer.<em>main</em>(Writer.java:32)rnrn打印那行语句还是能执行的。。。。
main"">java.lang.SecurityException Exception in thread "main"
Exception in <em>thread</em> "<em>main</em>" java.lang.SecurityException: Prohibited package name: java.sip.communicator.registrationrn at java.lang.ClassLoader.preDefineClass(ClassLoader.java:649)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:785)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)rn at java.net.URLClassLoader.access$100(URLClassLoader.java:71)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:361)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:423)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:356)rn at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:472)rnrn请问大侠知道的告诉一下.
main" 问题">Exception in thread "main" 问题
[code=java]import java.security.MessageDigest;rnimport java.security.NoSuchAlgorithmException;rnrnrnpublic class MD5Test rn /**rn * @param argsrn */rn public static void <em>main</em>(String[] args) rn String s = "123456";rn char hexDigits[] = rn '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',rn 'a', 'b', 'c', 'd', 'e', 'f'rn ;rn char str[];rn byte strTemp[] = s.getBytes();rn try rn MessageDigest mdTemp = MessageDigest.getInstance("MD5");rn mdTemp.update(strTemp);rn byte md[] = mdTemp.digest();rn int j = md.length;rn str = new char[j * 2];rn int k = 0;rn for (int i = 0; i < j; i++)rn byte byte0 = md[i];rn str[k++] = hexDigits[byte0 >>> 4 & 0xf];rn str[k++] = hexDigits[byte0 & 0xf];rn rn System.out.println(str);rn catch (NoSuchAlgorithmException e) rn e.printStackTrace();rn rn rnrn[/code]这是我的全部代码,我想以往一样,run as java application,结果说could not find the <em>main</em>rn控制台显示 java.lang.ClassNotFoundException,求大神帮忙解决下。在附加一个问题,我网上看到说md5加密已经到几秒就能被破解的地步了,那现在一般都用什么加密急速啊
main" java.lang.VerifyError:">Exception in thread "main" java.lang.VerifyError:
[b]Exception in <em>thread</em> "<em>main</em>" java.lang.VerifyError: (class: org/apache/hadoop/mapred/JobTrackerInstrumentation, method: create signature: (Lorg/apache/hadoop/mapred/JobTracker;Lorg/apache/hadoop/mapred/JobConf;)Lorg/apache/hadoop/mapred/JobTrackerInstrumentation;) Incompatible argument to function[/b]rnrn这个错误怎样解决?
main" java.lang.LinkageError:">Exception in thread "main" java.lang.LinkageError:
调用外部接口,通过myeclipse--web server client 一系列操作,得到一些文件,然后写测试demo,rnpublic static void <em>main</em>(String[] args) rn // TODO Auto-generated method stubrn EntpriseInfoImplService ent = new EntpriseInfoImplService();rn EntpriseInfoInterface eif = ent.getEntpriseInfoImplPort();rn String info=eif.findEnt(1, 2, "");rn //eif.findEnt(0, 10, "");rn System.out.println(info);rn //System.out.println(System.getProperty("java.endorsed.dirs")); rn rn rnrun as 运行报错:rnException in <em>thread</em> "<em>main</em>" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/F:/Program%20Files/Eclipse/Common/plugins/com.genuitec.eclipse.ws.xfire_9.0.0.me201211011550/lib/webservices-rt.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)rn at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:173)rn at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)rn at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)rn at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)rn at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)rn at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)rn at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)rn at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)rn at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:276)rn at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:273)rn at java.security.AccessController.doPrivileged(Native Method)rn at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:273)rn at com.sun.xml.ws.spi.ProviderImpl.(ProviderImpl.java:98)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:525)rn at java.lang.Class.newInstance0(Class.java:374)rn at java.lang.Class.newInstance(Class.java:327)rn at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)rn at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)rn at javax.xml.ws.spi.Provider.provider(Provider.java:76)rn at javax.xml.ws.Service.(Service.java:57)rn at com.dj.entservice.EntpriseInfoImplService.(EntpriseInfoImplService.java:56)rn at com.dj.entservice.TestEntpriseinfo.<em>main</em>(TestEntpriseinfo.java:14)rnrn在网上查的解决办法不对,请大家来分析一下是什么原因呢rn
main" java.lang.NoClassDefFoundError">Exception in thread "main" java.lang.NoClassDefFoundError
public class HelloWorldrnrn public static void <em>main</em>(String[] args)rn rn String s="Hello world.";rn System.out.println(s);rn rnrnrn很简单的一个程序。rn刚开始:javac HelloWorld.java okrn然后:java HelloWorldrn就报这个错误!如何解决
main" java.lang.ArrayIndexOutOfBoundsException">Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
[code=Java]rnpublic class UseStudent rnrn String Sname;rn int SNo;rn int age;rnrn UseStudent(String Sna, int Sno,int ag) rn Sname = Sna;rn SNo = Sno;rn age = ag;rn rnrn public static void <em>main</em>(String args[]) rnrn int i,j;rnrn UseStudent[] myarray =new UseStudent[3];rn for(i=0;i java.lang.ArrayIndexOutOfBoundsException: 3rn at UseStudent.<em>main</em>(UseStudent.java:19)rn
main" java.lang.NoclassDefFoundError:***">exception in thread "main" java.lang.NoclassDefFoundError:***
我想运行程序的话就提示这样:rn<em>exception</em> in <em>thread</em> "<em>main</em>" java.lang.NoclassDefFoundError:***rn是不是类库的问题,还是什么问题?
main" java.lang.NoClassDefFoundError:***">Exception in thread "main" java.lang.NoClassDefFoundError:***
同样的class在别的机器上可以RUNrn为什么到了我的机器上就出现这个提示啊rn我的PATH和他们的是一样的
main" java.lang.UnsupportedClassVersionError">Exception in thread "main" java.lang.UnsupportedClassVersionError
如题
main" java.awt.HeadlessException">Exception in thread "main" java.awt.HeadlessException
請問解決以下報錯的方法:rnrnException in <em>thread</em> "<em>main</em>" java.awt.HeadlessExceptionrn at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)rn at java.awt.Window.(Window.java:536)rn at java.awt.Frame.(Frame.java:420)rn at java.awt.Frame.(Frame.java:385)rn at javax.swing.JFrame.(JFrame.java:189)rn at com.stepforward.Mirrorworld.P4_View.Thing_Manager_View.(Thing_Manager_View.java:68)rn at com.stepforward.Mirrorworld.P2_Base_Bean.Thing_Manager_Service.Set_visible(Thing_Manager_Service.java:33)rn at com.stepforward.Mirrorworld.MirrorworldApplication.<em>main</em>(MirrorworldApplication.java:24)rnrn背景:rnrn我計劃把已在開發的非web工程轉換成web工程,我打算分兩步實施:先將非web工程搬到spring boot架構上,然後再來開發表示層組件。
main" java.lang.StackOverflowError .">Exception in thread "main" java.lang.StackOverflowError .
package 折半递归非递归;rnrnrnpublic class RecursiveTest rn /** * 递归实现 * * @param n * @return */ rn public static double recursive(long n) rn if (n == 1) rn return Math.log(1); rn rn else rn return Math.log(n) + recursive(n - 1); rn rn rn /** * 非递归实现 * * @param n * @return */ rn public static double directly(long n) rn double result = 0; rn for (int i = 1; i java.lang.StackOverflowErrorrn at 折半递归非递归.RecursiveTest.recursive(RecursiveTest.java:11)rn at 折半递归非递归.RecursiveTest.recursive(RecursiveTest.java:11)rn at 折半递归非递归.RecursiveTest.recursive(RecursiveTest.java:11)rnrn请问如何解决
main" java.lang.StackOverflowError">Exception in thread "main" java.lang.StackOverflowError
class Linkrn class Nodern private String data;rn private Node next;rn public Node(String data)rn this.data=data;rn rn public void add(Node newnode)//增加节点rn if(this.next==null)rn this.next=newnode;rn rn this.next.add(newnode); rn rn rn public void print()//打印rn System.out.println(this.data+"\t");rn if(this.next!=null)rn this.next.print();rn rn rn public boolean search(String data)rn if(this.data==data)rn return true;rn elsern if(this.next!=null) rn this.next.search(data);rn rn return false;rn rn rn rn public void delete(Node previous,String data)rn if(data.equals(this.data))rn previous.next=this.next;rn else rn if(this.next!=null)rn this.next.delete(this, data);rn rn rn rn ;rn private Node root;rn public void addNode(String data)rn Node newnode=new Node(data);rn if(this.root==null)rn this.root=newnode;rn rn this.root.add(newnode);rn rn public void printNode()rn if(this.root!=null)rn this.root.print();rn rn rn public boolean contains(String name)rn return this.root.search(name);rn rn public void deleteNode(String data)rn if(this.contains(data))rn if(this.root.data.equals(data))rn this.root=this.root.next;rn elsern this.root.next.delete(root, data);rn rn rn rn rn public class LinkDemo rn public static void <em>main</em>(String[] args)rn Link l=new Link();rn l.addNode("A");rn l.addNode("B");rn l.addNode("C");rn l.addNode("D");rn l.addNode("E");rn System.out.println("---------删除之前--------");rn l.printNode();rn l.deleteNode("C");rn l.deleteNode("A"); rn System.out.println("---------删除之后--------");rn l.printNode();rn System.out.println(l.contains("A"));rn rn rnrnrnthis.next.add(newnode); this.next.print(); this.next.search(data);屏蔽这3句得到结果rn---------删除之前--------rnA rn---------删除之后--------rnA rntruernrn我不想屏蔽这3句rn没屏蔽的错误Exception in <em>thread</em> "<em>main</em>" java.lang.StackOverflowErrorrn at 折半递归非递归.Link$Node.add(LinkDemo.java:14)rn at 折半递归非递归.Link$Node.add(LinkDemo.java:14)rnLinkDemo.java:14 指的是this.next.add(newnode);rn依次都是这样
java:Exception in threadmain
文件一:rnpublic class PointDemornprivate class Point//成员内嵌类rn//私有域成员rnprivate int x,y;rn//构造rnpublic Point()rn//设置rnpublic void setPoint(int x,int y)rnthis.x=x;rnthis.y=y;rnrn//获得rnpublic int getX()return x;rnpublic int getY()return y;rnrnrn//域成员rnprivate Point[] points;rn//构造rnpublic PointDemo(int length)rnpoints = new Point[length];rnfor(int i=0;i
main" java.lang.NullPointerExce">Exception in thread "main" java.lang.NullPointerExce
class CreaditCard rn private String name;rn private String password;rn private int balance;rn public CreaditCard(String name,String passowrd) rn this.name = name;rn this.password = password;rn rn public CreaditCard() rn rn public String getName() rn return name;rn rn public int seeBalance() rn return balance;rn rn public void setPassword(String password) rn this.password = password;rn rn public void setBalance(int balance) rn this.balance += balance;rn rn public boolean getBalance(int balance) rn boolean b = true;rn if(this.balance
main" java.long.NoClassDefFoundError:">exception in thread "main" java.long.NoClassDefFoundError:
出学JAVA 不知,做了小“hello"的程序,编译过了,可到执行时就出了上面的rn东东。请大家帮我。我想了想可能是java运行环境没有设好,可是编译过了,不明rn请大家帮忙。
main" java.">Exception in thread "main" java.
rn class ck rnrn /**rn * @param argsrn */rn public static void <em>main</em>(String[] args) rn // TODO Auto-generated method stubrn int n=Integer.parseInt(args[0]);rn for(int i=1;i=i;k--)rn rn System.out.print(" ");rn rn rn for(int j=1;j java.lang.ArrayIndexOutOfBoundsException: 0rn at ck.<em>main</em>(ck.java:9)rn
main"java.lang.NoclassDefFoundError">Exception in thread "main"java.lang.NoclassDefFoundError
出错Exception in <em>thread</em> "<em>main</em>"java.lang.NoclassDefFoundErrorrn代码如下:rn-----------------------rnpackage hello;rnpublic class Hellorn public static voidrn <em>main</em>(String arg[]) rn System.out.println(new String("Hello, World!"));rn rn
main" org.springframework.beans.factory.BeanCreationExcepti">Exception in thread "main" org.springframework.beans.factory.BeanCreationExcepti
[code=java]Exception in <em>thread</em> "<em>main</em>" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested <em>exception</em> is org.hibernate.MappingException: An AnnotationConfiguration instance is required to use rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at lee.Main.<em>main</em>(Main.java:18)rnCaused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use rn at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1648)rn at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)rn at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)rn at org.hibernate.cfg.Configuration.configure(Configuration.java:1491)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:642)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)rn ... 12 more[/code]rnrnhibernate.cfg.xmlrn[code=java]rnrnrnrnrn rn jdbc:mysql://127.0.0.1:3306/mysqlrn rootrn 123456rn com.mysql.jdbc.Driverrn testrn rn truern truern updatern org.hibernate.dialect.MySQL5InnoDBDialectrn rn rn rn rnrn[/code]rnrnrnapplicationContext.xmlrn[code=java]rnrnrnrn rn rnrn rn rn rn rn rn [/code]rnrn
main" java.lang.">Exception in thread "main" java.lang.
从svn上down下来的源码,在搭建本机环境的时候报错nn```n Exception in <em>thread</em> "<em>main</em>" java.lang.UnsupportedClassVersionError: org/apdplat/word/analysis/TextSimilarity : Unsupported major.minor version 52.0n 2 at java.lang.ClassLoader.defineClass1(Native Method)n 3 at java.lang.ClassLoader.defineClass(Unknown Source)n 4 at java.security.SecureClassLoader.defineClass(Unknown Source)n 5 at java.net.URLClassLoader.defineClass(Unknown Source)n 6 at java.net.URLClassLoader.access$100(Unknown Source)n 7 at java.net.URLClassLoader$1.run(Unknown Source)n 8 at java.net.URLClassLoader$1.run(Unknown Source)n 9 at java.security.AccessController.doPrivileged(Native Method)n10 at java.net.URLClassLoader.findClass(Unknown Source)n11 at java.lang.ClassLoader.loadClass(Unknown Source)n12 at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)n13 at java.lang.ClassLoader.loadClass(Unknown Source)n14 at com.platform.config.run.JfinalConfig.afterJFinalStart(JfinalConfig.java:184)n15 at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:55)n16 at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)n17 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)n18 at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)n19 at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)n20 at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)n21 at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)n22 at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:492)n23 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)n24 at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)n25 at org.eclipse.jetty.server.Server.doStart(Server.java:277)n26 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)n27 at com.jfinal.server.JettyServer.doStart(JettyServer.java:135)n28 at com.jfinal.server.JettyServer.start(JettyServer.java:67)n29 at com.jfinal.core.JFinal.start(JFinal.java:154)n30 at com.platform.config.run.JfinalConfig.<em>main</em>(JfinalConfig.java:210)n```n在各种网站上查阅了一下,说是用低版本的JDK编译高版本的.class就会报这个错,有以下两种易发生的情况:nn1,命令行输入java -version和javac -version发现版本不一致,修改之;nn2,版本一致则检查Path路径,一般安装oracle的机子配置jdk的时候会覆盖路径,修改之。nn但是!nn一,我没有装Oracle;nnPath路径为:nnd:\data\mblog\graphicsmagick-1.3.23-q8;nC:\Windows\system32;nC:\Windows;nC:\Windows\System32\Wbem;nC:\Windows\System32\WindowsPowerShell\v1.0\;nD:\jdk1.7\bin;nD:\jdk1.7\jre\bin;nD:\mysqlinstallation\MySQL Utilities 1.3.6\;nD:\maven\apache-maven-3.3.9\bin;nn二,javac -versionnn下是java version “1.7.0_13”nnjava -version下是nnjavac 1.7.0_13nn所以,现在问题会出现在哪儿呢?nn我使用的是eclipse,jfinal,mavenn
main" javax.naming.CommunicationException">Exception in thread "main" javax.naming.CommunicationException
运行一个简单的Ejb,出现以下异常rnException in <em>thread</em> "<em>main</em>" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root <em>exception</em> is java.net.SocketTimeoutException: Receive timed out] [Root <em>exception</em> is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root <em>exception</em> is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root <em>exception</em> is java.net.ConnectException: Connection refused: connect]]]rn at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)rn at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)rn at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)rn at javax.naming.InitialContext.lookup(InitialContext.java:392)rn at com.jack.ejb.FirstEjbClient.<em>main</em>(FirstEjbClient.java:8)rnCaused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root <em>exception</em> is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root <em>exception</em> is java.net.ConnectException: Connection refused: connect]]rn at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)rn at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)rn ... 4 morernCaused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root <em>exception</em> is java.net.ConnectException: Connection refused: connect]rn at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)rn ... 5 morernCaused by: java.net.ConnectException: Connection refused: connectrn at java.net.PlainSocketImpl.socketConnect(Native Method)rn at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)rn at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)rn at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)rn at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)rn at java.net.Socket.connect(Socket.java:519)rn at java.net.Socket.connect(Socket.java:469)rn at java.net.Socket.(Socket.java:366)rn at java.net.Socket.(Socket.java:267)rn at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)rn at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)rn at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)rn ... 5 morern配置文件:rn[img=https://img-bbs.csdn.net/upload/201403/14/1394777087_345096.jpg][/img]rnjboss配置文件:rn[img=https://img-bbs.csdn.net/upload/201403/14/1394777924_900237.jpg][/img]rnrnrn查看jnp端口,未占用;jboss-client.jar和jnp.jar都添加了;rnjboss配置文件中未找到jboss-service.xml和server.xml;rndo<em>main</em>.xml文件中未找到修改端口的代码rnrn
main" java.lang.OutOfMemoryError: Java heap space,怎么办">Exception in thread "main" java.lang.OutOfMemoryError: Java heap space,怎么办
Exception in <em>thread</em> "<em>main</em>" java.lang.OutOfMemoryError: Java heap space ,怎么办。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
main"">部署時出現錯誤:java.lang.OutOfMemoryError Exception in thread "main"
weblogic8.1rnjbuilder2005rnwindows2000professionrnrn部署時出現錯誤:java.lang.OutOfMemoryError rnException in <em>thread</em> "<em>main</em>"rnrn請教高手如何解決這個問題?
main" java.lang.OutOfMemoryError: Java heap space怎么捕获他">Exception in thread "main" java.lang.OutOfMemoryError: Java heap space怎么捕获他
Exception in <em>thread</em> "<em>main</em>" java.lang.OutOfMemoryError: Java heap space这个异常怎么捕获他?rn就是说catch()哪个异常,才能捕获该异常?我试过Exception,也试过io<em>exception</em>,似乎都不行
main" java.lang.OutOfMemoryError: Java heap space">(迷宫问题?)Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
这是这个迷宫类(Maze):rnpackage disizhang.dao;rnrnimport java.util.Stack;rnrnimport jss2.LinkedStack;rnrnimport diliuzhang.dao.StackADT;rnrnrnpublic class Maze rn rn /**rn * 常熟来尝试的途径rn */rn private final int Tried=3;rn /**rn * 常数来表示最后的路径rn */ rn private final int path=7;rn /**rn * 而为数组代表迷宫rn */rn private int [] [] grid=1,1,1,0,1,1,0,0,0,1,1,1,1,rn 1,0,0,1,1,0,1,1,1,1,0,0,1,rn 1,1,1,1,1,0,1,0,1,0,1,0,0,rn 0,0,0,0,1,1,1,0,1,0,1,1,1,rn 1,1,1,0,1,1,1,0,1,0,1,1,1,rn 1,0,1,0,0,0,0,1,1,1,0,0,1,rn 1,0,1,1,1,1,1,1,0,1,1,1,1,rn 1,0,0,0,0,0,0,0,0,0,0,0,0,rn 1,1,1,1,1,1,1,1,1,1,1,1,1;rn rn rn /**rn * 一种新的attemped推移到堆栈rn * @param rn * @param x代表x坐标rn * @param y代表y坐标rn * @param栈内工作堆移动网格rn * @return StackADT > push_new_pos(int x,int y,StackADT stack)rn rn rn Position npos=new Position();rn npos.setX(x);rn npos.setY(y);rn if(valid(npos.getX(),npos.getY()))rn rn stack.push(npos);rn rn return stack; rn rn rn rn public boolean traverse()rn rn boolean done=false;rn Position pos=new Position();rn Object dispose;rn StackADT stack=new LinkedStack();rn stack.push(pos);rn rn while(!(done))rn rn pos=stack.pop();rn grid[pos.getX()][pos.getY()]=Tried; //这条通道已经试过rn if(pos.getX()==grid.length-1 && pos.getY()==grid[0].length-1)rn done=true;rn elsern rn stack=push_new_pos(pos.getX(),pos.getY()-1,stack);rn stack=push_new_pos(pos.getX(),pos.getY()+1,stack);rn stack=push_new_pos(pos.getX()-1,pos.getY(),stack);rn stack=push_new_pos(pos.getX()+1,pos.getY(),stack);rn rn rn return done;rn rn rn rn private boolean valid(int d,int e)rn rn boolean result=false;rn /**Check if cell is in the bounds of the matrix*/rn if(d>=0 && d=0 && e
main" java.lang.OutOfMemoryError: Java heap space at ap">报错:Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at ap
需要对一个6566*200维的矩阵的每一行两两求距离,写了一个程序,可一直运行程序报错:Exception in <em>thread</em> "<em>main</em>" java.lang.OutOfMemoryError: Java heap space at apcluster.VectorCluster.<em>main</em>(VectorCluster.java:59),想请教一下大家是什么问题。请求各位帮帮忙。rn代码如下:rnpackage apcluster;rnrnimport java.io.File;rnimport java.io.FileReader;rnimport java.io.IOException; rnimport java.io.PrintWriter;rnrnpublic class VectorCluster rnrn public static void <em>main</em>(String[] args) throws IOExceptionrn rn double count=0;rn rn // get labelsrn File file = new File("C:\\Users\\Administrator\\Desktop\\word2vec资料\\txt\\label.txt");rn FileReader reader = new FileReader(file); rn int fileLen = (int)file.length();rn char[] chars = new char[fileLen];rn reader.read(chars);rn String content = String.valueOf(chars); //将存放在txt中的文本数据对人程序中 rn System.out.print("读入标签词");rn System.out.print("\t");rn String[] label = content.split(","); //将读取到的数据根据回车符号进行划分,再将其存储到字符串数组中去rn int labelsize=label.length;rn System.out.println(labelsize);rn rn // get wordvectorsrn File vfile = new File("C:\\Users\\Administrator\\Desktop\\word2vec资料\\txt\\word_vector.txt");rn FileReader vreader = new FileReader(vfile); rn int vfileLen = (int)vfile.length();rn char[] vchars = new char[vfileLen];rn vreader.read(vchars);rn String contentdata = String.valueOf(vchars); rn //运用逗号将每一个 数据存入一维数组中 rn String[] str = contentdata.split(",");rn int len=str.length;rn System.out.println(len);rn rn System.out.print("开始对存储词向量的一维数组进行转换操作,请稍等。。。。");rn rn int vecsize=200;rn double wordvector[][]=new double[labelsize][vecsize];rn for(int i=0;i
main" java.lang.OutOfMemoryError: Java heap space">内存不足 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Exception in <em>thread</em> "<em>main</em>" java.lang.OutOfMemoryError: Java heap spacern at oracle.jdbc.driver.OraclePreparedStatement.growBinds(OraclePreparedStatement.java:1447)rn at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2229)rn at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:9784)rn at oracle.jdbc.driver.OraclePreparedStatementWrapper.addBatch(OraclePreparedStatementWrapper.java:1358)rn at dao.SapDataDao.insertStudents(SapDataDao.java:140)rn at business.ScanCSVToDB.importToDB(ScanCSVToDB.java:536)rn at business.ScanCSVToDB.run(ScanCSVToDB.java:58)rn at client.ScanCSVTest.<em>main</em>(ScanCSVTest.java:36)rnrnrnrnrnPS:我VM 配置已经改为-Xms512m -Xmx1024m ,怎么还是报错啊,大神,求助啊 啊啊啊啊啊啊rn还要改哪里吗
thread "main" java.lang.NoSuchMethodError: main"是什么错误?">"Exception in thread "main" java.lang.NoSuchMethodError: main"是什么错误?
我是初学者,可是很多从书上抄下来的程序在运行时都报错(编译能过):rnException in <em>thread</em> "<em>main</em>" java.lang.NoSuchMethodError: <em>main</em>rn不知是什么原因,请大家指教rnrn我的JDK装在c:\jdkrn我的path中设了c:\jdk;c:\jdk\binrnSET CLASSPATH=.;C:\jdk\lib\tools.jarrnrn
main"是什么错误?">java.lang.NoSuchMethodError: main,Exception in thread "main"是什么错误?
我是java 入学者,在书上抄了一些例子编译,运行,有的可很好运行。rn可有一些出现下面问题:rnrnjava.lang.NoSuchMethodError: <em>main</em>rnException in <em>thread</em> "<em>main</em>"rn rn编译不行,请问各位大侠,那是什么问题,该如何解决,是不是还有什么软件要安装?rn
main"是什么错误??">java.lang.NoSuchMethodError: main,Exception in thread "main"是什么错误??
我是java 入学者,在书上抄了一些例子编译,运行,有的可很好运行。rn可有一些出现下面问题:rnrnjava.lang.NoSuchMethodError: <em>main</em>rnException in <em>thread</em> "<em>main</em>"rnrn就下面源代码:rnrnimport java.awt.*;rnimport java.applet.*;rnrnpublic class GridLayoutDemo extends Appletrnrn static final int n=4;rn public void init()rn rn setLayout(new GridLayout(n,n));rn setFont(new Font("Times New Roman", Font.BOLD, 24));rnrn for (int i=0; i0)rn add(new Button(""+k));rn rn rn rnrnrnrnrnrn编译不行,请问各位大侠,那是什么问题,该如何解决,是不是还有什么软件要安装?rnrn
main" java.lang.NoClassDefFoundError: 为什么?">Exception in thread "main" java.lang.NoClassDefFoundError: 为什么?
我写了一个JAVA程序,编译成功,当我执行的时候却出现下列错误,为什么?rnException in <em>thread</em> "<em>main</em>" java.lang.NoClassDefFoundError: e:\ConnectSocketrnrn程序如下:rnrnimport java.io.*;rnimport java.net.*;rnimport java.util.*;rnimport java.sql.*;rnrnclass ConnectSocketrn//与服务器连接rnpublic static void <em>main</em>(String[] args)rnSocket socket;rnString len;rnInputStream Is;rnOutputStream Os;rnDataInputStream DIS;rnPrintStream PS;rntryrn//向主机名为args[0]的服务器申请连接rn//注意端口号要与服务器保持一致:1001rnsocket=new Socket("10.21.5.19",1001);rnrnrncatch(Exception e)rnSystem.out.println("连接Error:"+e);rn rnrn
main" java.lang.NullPointerException">出现Exception in thread "main" java.lang.NullPointerException
import java.io.Console;rnpublic class ConsoleDemo rnpublic static void <em>main</em> (String[] args) rnSystem.out.print("请输入名称: ");rnConsole console = System.console();rnString name = console.readLine();rnSystem.out.println("你输入的名称..." + name);rnrnrn/** Creates a new instance of ConsoleDemo */rnpublic ConsoleDemo() rnrnrnrnrn直接在命令行编译运行通过,jdk6环境rn在netbeans5.5中编译通过,运行出现错误,请大家帮忙看看rn错误提示如下 :rnException in <em>thread</em> "<em>main</em>" java.lang.NullPointerExceptionrnat ConsoleDemo.<em>main</em>(ConsoleDemo.java:19)rn请输入名称:
main" java.lang.NoClassDefFoundError:Hello">Exception in thread "main" java.lang.NoClassDefFoundError:Hello
在我的电脑磁盘G盘里有Hello.java文件,内容如下:rn public class Hellornrn public static void <em>main</em>(String[] args)rn rn String str = "hello";rn System.out.println(str);rn rnrnrnrn我在Dos下运行命令:rnrnG:\>javac Hello.java (编译正常)rnG:\>java Hellornrn出现问题:rnException in <em>thread</em> "<em>main</em>" java.lang.NoClassDefFoundError:Hellornrnrn这段代码在eclips里运行完全正常。
main" java.lang.NoClassDefFoundError: Exception2">Exception in thread "main" java.lang.NoClassDefFoundError: Exception2
设计方法boolean prime(int n),用来判断数n是否为素数,若为素数,返回ture;若不是素数,返回false;若nk) flag=true; rnreturn flag; rn rnpublic static void <em>main</em>(String args[]) rntry rnint n=Integer.parseInt(args[0]); rnSystem.out.println(prime(n)); rn rncatch(ArgumentOutOfBoundException e) rn rnSystem.out.println(e.toString()); rn rn rn rn
main" java.lang.NullPointerException">运行时Exception in thread "main" java.lang.NullPointerException
这是我的源代码~不知道哪里错了~请教~谢谢rnimport java.io.*;rnpublic class Gradernrn public static void <em>main</em>(String args[])rn rn int num,average,num1,num2;rn char ch;rn FileInputStream fin;rn DataInputStream din=null;rn tryrn while ((ch=din.readChar())!='\n')rn rn fin=new FileInputStream("d:\\test\\1.txt");rn din=new DataInputStream(fin);rn ch=din.readChar();rn num1=din.readInt();rn num2=din.readInt();rn num=num1+num2;rn average=((num1+num2)/2);rn System.out.println(ch+num+average);rn rn System.out.println("输出完毕");rn rn catch (Exception e)rn rn System.out.println("Error!");rn rn rn rnrnrn运行出现Exception in <em>thread</em> "<em>main</em>" java.lang.NullPointerException
main"不知名的错误!!!!">Exception in thread "main"不知名的错误!!!!
package aa; rnrnimport java.io.BufferedInputStream; rnimport java.io.File; rnimport java.io.BufferedOutputStream; rnimport java.io.IOException; rnimport java.io.FileInputStream; rnimport java.io.FileOutputStream; rnrnpublic class Util rnrn public Util() rn rnrn public static byte[] readFile(String filename) throws IOException rnrn File file = new File(filename); rn if (filename == null || filename.equals("")) rn throw new NullPointerException("无效的文件路径"); rn rn long len = file.length(); rn byte[] bytes = new byte[(int) len]; rnrn BufferedInputStream bufferedInputStream = new BufferedInputStream(new rn FileInputStream(file)); rn int r = bufferedInputStream.read(bytes); rn if (r != len) rn throw new IOException("读取文件不正确"); rn rn bufferedInputStream.close(); rn return bytes; rn rnrn public byte[] readFileJar(String filename) throws IOException rn BufferedInputStream bufferedInputStream = new BufferedInputStream( rn getClass().getResource(filename).openStream()); rn System.out.println(filename); rn int len = bufferedInputStream.available(); rn byte[] bytes = new byte[len]; rn int r = bufferedInputStream.read(bytes); rn if (len != r) rn bytes = null; rn throw new IOException("读取文件不正确"); rn rn bufferedInputStream.close(); rn return bytes; rn rnrnrn public static void <em>main</em>(String[] args) rn Util util = new Util(); rn try rn util.readFile("D:\\XiaoFei\\aaaaaa.txt"); rn util.readFileJar("D:\\XiaoFei\\aaaaaa.txt"); rnrn catch (IOException ex) rn rn rn rn这是代码! rn以下是错误提示: rnjava.lang.NullPointerException rnrnat aa.Util.readFileJar(Util.java:35) rnrnat aa.Util.<em>main</em>(Util.java:54) rnrnException in <em>thread</em> "<em>main</em>" rnrn报错位置: rnBufferedInputStream bufferedInputStream = new BufferedInputStream( rn getClass().getResource(filename).openStream()); rnutil.readFileJar("D:\\XiaoFei\\aaaaaa.txt"); rn不知道是什么错误!!!!求高手解决~
实现浩方平台的半成品代码下载
此为转载 浩方网上作战平台运行环境模拟,完成了一半,需要进一步调试,不过已经很好了(个人认为)!-this side of the Gallant reproduced online platform runtime environment simulation, completed half of the need for further testing, but has a very good (think)! 相关下载链接:[url=//download.csdn.net/download/pengxiao_007/2416212?utm_source=bbsseo]//download.csdn.net/download/pengxiao_007/2416212?utm_source=bbsseo[/url]
NXP1100系列中文数据手册下载
周产功M0系列芯片,LPC1100系列中文数据手册。与大家共享一下 相关下载链接:[url=//download.csdn.net/download/mars5514/5758019?utm_source=bbsseo]//download.csdn.net/download/mars5514/5758019?utm_source=bbsseo[/url]
微软Visual Studio 2013 RC泄露版下载
对于喜欢尝鲜与跟进微软步伐的应用开发者们来说,你们或许正运行着今年6月发布的预览版Visual Studio 2013。9月3日,带远程工具(with Remote Tools)的VS 2013候选发布版本(Release Candidate)已经被泄露到了互联网上。与Windows 8.1预览版一同发布的VS 2013预览版,带来了更好的应用程序生命周期管理功能、对Git的内建支持、基于云端的调试、以及单元测试失败的信息显示和新的代码编辑器等特性。 泄露Windows 8.1 RTM的伙计名叫Wzor,现在,他又泄出了VS 2013 RC版——版本号为12.0.20824.1。 微软先前 相关下载链接:[url=//download.csdn.net/download/vs880/6208329?utm_source=bbsseo]//download.csdn.net/download/vs880/6208329?utm_source=bbsseo[/url]
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池
我们是很有底线的