Results 1 to 19 of 19
Thread: Can't compile
- 08-28-2012, 05:35 PM #1
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Can't compile
I am trying to compile a Java project, I am new to Java but I have a basic/good programming logic. (did some AS3, PHP+MySQL here and there).
I basically made some changes to .java files, then compiled to .jar. (did this in "eclipse-java-europa-winter-win32") When I run the .jar I get an error:
"Exception in thread 'main' java.lang.noclassdeffounderror: ch/ubique/inieditor/IniEditor"
When I compile the Default files without making any changes, I get the same error. - that's why I think its a compiling problem / me not knowing Java
The files / project are right here:
gatherbot_rlease.zip - tf2gatherbot - Gather Bot stable rlease - Team Fortress 2 IRC Gather Bot - Google Project Hosting
If someone could please point out what the problem is / what Newbie mistake I am making
Thanks in advance,
Trath
- 08-28-2012, 05:39 PM #2
Re: Can't compile
Please post the full text of the error messages and the code that is causing them. Copy and paste the messages, don't type them in, so there is full text and correct spelling.
If you don't understand my response, don't ignore it, ask a question.
- 08-28-2012, 05:45 PM #3
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
D:\GatherBot>java -jar d.jar
Exception in thread "main" java.lang.NoClassDefFoundError: ch/ubique/inieditor/I
niEditor
at Main.main(Main.java:15)
Caused by: java.lang.ClassNotFoundException: ch.ubique.inieditor.IniEditor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
D:\GatherBot>
- 08-28-2012, 05:53 PM #4
Re: Can't compile
That's a runtime error, not a compiler error.Caused by: java.lang.ClassNotFoundException: ch.ubique.inieditor.IniEditor
Where is the class mentioned in the error message? The java program can not find it.If you don't understand my response, don't ignore it, ask a question.
- 08-28-2012, 06:02 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: Can't compile
Yep.
Is that class in the jar file?
Looks like it isn't.Please do not ask for code as refusal often offends.
- 08-28-2012, 06:21 PM #6
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
Yes, I have inieditor.jar in the .classpath just as some other classes are used.
- 08-28-2012, 06:23 PM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: Can't compile
No.
Is that class in the d.jar file you seem to be trying to run?
Is it in the ch/ubique/inieditor "folder" in the jar?Please do not ask for code as refusal often offends.
- 08-28-2012, 06:30 PM #8
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
The class is in iniedtior.jar which is in the "libs" folder. The .classpath references to that jar file.
Just like the sqlite class is in "sqlitejdbc-v056.jar" which is refrenced in the .classpath .
- 08-28-2012, 06:45 PM #9
Re: Can't compile
Can you open a command prompt window and enter: SET
which will print out the values of all the environment variables. Copy the value for CLASSPATH here.If you don't understand my response, don't ignore it, ask a question.
- 08-28-2012, 06:50 PM #10
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
D:\GatherBot>SET
ALLUSERSPROFILE=C:\ProgramData
AMDAPPSDKROOT=C:\Program Files (x86)\AMD APP\
APPDATA=C:\Users\Yoni\AppData\Roaming
asl.log=Destination=file
CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=YONI-PC
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Yoni
LOCALAPPDATA=C:\Users\Yoni\AppData\Local
LOGONSERVER=\\YONI-PC
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bi
n\x86;C:\Windows\system32;C:\Windows;C:\Windows\Sy stem32\Wbem;C:\Windows\System3
2\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-S
tatic;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Autodesk
\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x8
6)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\10
0\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Fil
es (x86)\Java\jdk1.7.0_06\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 26 Stepping 5, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a05
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell \v1.0\Modules\
PUBLIC=C:\Users\Public
QTJAVA=C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Yoni\AppData\Local\Temp
TMP=C:\Users\Yoni\AppData\Local\Temp
USERDOMAIN=Yoni-PC
USERNAME=Yoni
USERPROFILE=C:\Users\Yoni
VS100COMNTOOLS=d:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
\
windir=C:\Windows
D:\GatherBot>
- 08-28-2012, 06:52 PM #11
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
btw:
When I choose the "run" option and then "Java Application" and choose "Main", it seems to be working in the console.
Yet still when compiled, same error.
- 08-28-2012, 07:06 PM #12
Re: Can't compile
Here is the CLASSPATH from your PC
Where are the jar files with the missing classes?CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
What did you mean when you said:
The .classpath references to that jar file.If you don't understand my response, don't ignore it, ask a question.
- 08-28-2012, 07:11 PM #13
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
I mean theres a file called ".classpath" that says this:
Maybe its just for eclipse? anyway, it refrences all the .jar librarys to be used.Java Code:<?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="lib" path="libs/gameserver-2010-03-17.jar"/> <classpathentry exported="true" kind="lib" path="libs/inieditor.jar"/> <classpathentry kind="lib" path="libs/jdom.jar"/> <classpathentry kind="lib" path="libs/mysql-connector-java-5.1.12-bin.jar"/> <classpathentry kind="lib" path="libs/pircbot.jar"/> <classpathentry kind="lib" path="libs/QueriEd.jar"/> <classpathentry kind="lib" path="libs/RconEd.jar"/> <classpathentry kind="lib" path="libs/sqlitejdbc-v056.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="/DefaultBot/libs/inieditor-r2.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
- 08-28-2012, 07:42 PM #14
Re: Can't compile
its just for eclipse, the java command does not use it.
If you don't understand my response, don't ignore it, ask a question.
- 08-28-2012, 08:28 PM #15
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: Can't compile
Not only that the CLASSPATH environment variable (apart from being a bad thing to use for your classpath) is not used when executing jar files with the -jar switch.
The classpath used for that is held in the MANIFEST.
So, does the manifest in the jar file list those jars?
I'm guessing not.Please do not ask for code as refusal often offends.
- 08-28-2012, 08:28 PM #16
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
Re: Can't compile
Then how do I fix the problem?
I don't care what I compile with, as long as it works.
- 08-28-2012, 08:32 PM #17
Member
- Join Date
- Aug 2012
- Posts
- 10
- Rep Power
- 0
- 08-28-2012, 08:35 PM #18
Re: Can't compile
If you don't understand my response, don't ignore it, ask a question.
- 08-29-2012, 09:39 AM #19
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Re: Can't compile
If you want to generate an executable jar, along with its dependencies, in Eclipse then this is an Eclipse question and should be moved to that forum.
If you want to try this by hand (using the link Norm provides) then it can remain here.Please do not ask for code as refusal often offends.
Similar Threads
-
why won't this compile
By joet1984 in forum Advanced JavaReplies: 4Last Post: 08-31-2011, 09:50 AM -
What to do here(cant compile)?
By Pojahn_M in forum New To JavaReplies: 8Last Post: 08-06-2011, 01:55 AM -
why i can not compile? please help
By zypchun in forum New To JavaReplies: 3Last Post: 04-20-2011, 05:48 PM -
would this compile?
By stringkilla in forum New To JavaReplies: 10Last Post: 10-24-2010, 03:27 PM -
Help with compile
By mr_anderson in forum NetBeansReplies: 7Last Post: 06-10-2010, 04:03 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks