打开.project文件,从其他可以有运行main的地方copy一个maven的builder过来,补上就好了。
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>xxx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
...
原因猜测:ecilpse的工程运行main的时候需要builder去提供类路径吧,然后没有builder相当于classpath少了一部分,纯属猜测
相关推荐
System.out.println("Could not find the driver."); e.printStackTrace(); } catch (SQLException e) { System.out.println("Failed to connect to the database."); e.printStackTrace(); } } } ``` 在上述...
System.out.println("Could not find the driver."); e.printStackTrace(); } catch (SQLException e) { System.out.println("Error connecting to the database."); e.printStackTrace(); } } } ``` 在这个...
System.out.println("Could not find the driver."); e.printStackTrace(); } catch (SQLException e) { System.out.println("Error connecting to the database."); e.printStackTrace(); } } } ``` 在上述...
System.out.println("Could not find the driver."); e.printStackTrace(); } catch (SQLException e) { System.out.println("Error connecting to the database."); e.printStackTrace(); } } } ``` 在上述...
System.out.println("Could not find the driver."); e.printStackTrace(); } catch (SQLException e) { System.out.println("Error connecting to the database."); e.printStackTrace(); } } } ``` 在这个...