谷歌搜索幾個小時了,沒有解決方案似乎暗示問題可能是什麼,我已經嘗試了所有,他們不工作。問題是我有一個項目(Eclipse項目)在Github上,我現在在另一臺計算機上試圖在我的項目上工作。我導入它,得到了分支,但是當我運行該項目時,我得到一個Error: Could not find or load main class engine.Game
無法找到或加載主
不知道什麼可能是錯的,除了這臺計算機缺乏JRE7,但我只是將它下載到一個文件夾並將其添加到庫這個構建。我添加的另一個庫使用了一個固定的文件引用C:/...
,但我通過將它指向eclipse項目中的jar來解決這個問題。
我總是把.classpath
和.project
改成git,除了今天之外,它一直在工作。
我認爲問題是,JVM嘗試運行從包含JRE7該文件夾中的文件,但不是在我的項目。我只注意到控制檯頭寫着:
<terminated> Game [Java Application] /home/USER/Desktop/jre1.7.0_17/bin/java
對於下面張貼的classpath約bin文件夾的要求: 的集裝箱完全是空的,但由於主要難怪找不到。
類路徑
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="info"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="libs"/>
<classpathentry kind="src" path="res"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="/home/aryann/git/KLT/libs/JOrbis.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
項目
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>KLT</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>