Paschu Posted May 9, 2005 Report Posted May 9, 2005 Hello !! I've started to learn about the UIPC_JAVA_SDK-Kit , involved in the FSUIPC_SDK of Peter Dawson !! But during compiling the Application Test.java (respectively Test.class) the Compiler "says", that the package com.flightsim.fsuipc.* (which is contained in the fsuipc.jar) doesn't exist, even I have include this JAR-File !! And without this JAR-File a connection between Java and FS2004 isn't possible !! SO...maybe someone can tell me if this problem is known (and maybe how to resolve it) or what at all I'm doing wrong !! Many thanx Paschu
rady Posted May 9, 2005 Report Posted May 9, 2005 Paschu - Look down the page a bit and you will see the FSUIPC support forum. Peter Dowson, himself, posts there. You probably will get a quicker and more complete answer to your question if you post there. :) Cheers! Roger
jwenting Posted May 9, 2005 Report Posted May 9, 2005 What is the exact command you're issueing to the Java compiler? And what is your classpath? Give those and I may be able to help you, as it sounds like one or the other is incorrect.
Paschu Posted May 10, 2005 Author Report Posted May 10, 2005 Ok...here I'll give the things, maybe you can see my fault !! In general, I type in this: C:\Program Files\FSUIPC_SDK\UIPC_SDK_JAVA\test\src>javac Test.java and then the Compiler becomes crazy and says, there is no fsuipc-package (or respectively no package com.flightsim.fsuipc) The Classpath (i.g. the Path where the Test.class is located) is: C:\Program Files\FSUIPC_SDK\UIPC_SDK_JAVA\test\build> I have to mention, that I've nothing changed...I did the Installation like recommended in Mark Burtons "Documentation" (whic was one page of a Word-Document) ! Hopefully you can help me or even show me how silly I was... thanx a lot Paschu
jwenting Posted May 10, 2005 Report Posted May 10, 2005 try javac -classpath ../build/fsuipc.jar Test.java then when running you will need java -cp ../build/fsuipc.jar Test Of course change the commandlines for the correct location of the jarfile if it's elsewhere :) As an alternative you can set the classpath permanently by creating (or changing) the system variable CLASSPATH from your system properties to include the jar.
Paschu Posted May 10, 2005 Author Report Posted May 10, 2005 Sorry...I forgot to mention, that I've imported the Applikation (Test.java + Libraries) into the Eclipse platform as an project...the effect is the same as with the command line when running the program...there are shown only default values as if there is no connection to FS2004 even there is shown no error with respect to the package...but I think (because of the output), that the package isn't identified as well !! regards Paschu
Paschu Posted May 10, 2005 Author Report Posted May 10, 2005 :oops: thanx a lot for this tip....it seems to be working, because the package is no more missed !! But another error occured, maybe you know....starting the test.class after compiling the program throws the following exception: Exception in thread "main" java.lang.NoClassDefFoundError: test I know what this exception means, but I'm not sure if I know WHY it is thrown ? Have you any idea !? Thanx for helping...Paschu
jwenting Posted May 10, 2005 Report Posted May 10, 2005 Java is case sensitive. You need to have the class Test (capital T) in a file names Test.java (capital T) which gets compiled into a file called Test.class (again a capital T). You then need to call it with "java Test" again using a capital T.
Paschu Posted May 10, 2005 Author Report Posted May 10, 2005 Ok...that's the case....there's always a capital Letter at the Beginning ! I think he throws the exception because of the fsuipc_wrapper.class...is it possible and if so why !? I thought, that the fsuipc.jar provides sth. like an interface (to FS2004) you can work with...and now it doesn't run :?: Thanx Paschu
jwenting Posted May 10, 2005 Report Posted May 10, 2005 your error message showed it could not find a class test. That means you'd tried "java test" instead of "java Test". Also make sure you have the dll from the test directory on your system path. Having it in the same directory you call java from will work fine. And add the current directory (".") to your classpath as well.
Paschu Posted May 11, 2005 Author Report Posted May 11, 2005 Hello and thanx for answering again :wink: I tried all you said and sth. that was written in the (really short) Documentation of Mark Burton....but I'm still unsatisfied Following happened: I compiled the Test.java as recommended...worked fine The I typed in following line : java -classpath .;fsuipc.jar Test I did it this way (fsuipc.jar is now in the same folder like Test.java), because it was written in the Docu and I just tried ! However no Error occured but the result wasn't very well....most Values had a value of 0 (respectively 0.0) which seems to be a Default-value and a few others even are empty (f.ex. ID, Name, TestFlightSim)....that's why I come to the conclusion, that I'm yet not connected to the FS2004 via the interface !??? Ohh...and when I type in following java -classpath .;fsuipc.jar Test.class the same error is displayed as before.... WHAT AM I DOING WRONG ?! Can't believe... Thanx...Paschu
jwenting Posted May 11, 2005 Report Posted May 11, 2005 your last commandline tries to run a class called class contained in a package called Test. That would equate to a file class.class in a directory Test. You seem to have very little (if not none at all) experience with Java. Maybe you should start with some beginners' tutorials?
Paschu Posted May 11, 2005 Author Report Posted May 11, 2005 Not at all...but I have only less experiences with the f... Windows command shell and of course with the FS2004...that's my problem !!
jwenting Posted May 11, 2005 Report Posted May 11, 2005 ok. Your questions seem to indicate a fundamental lack of Java basics, that's all. Some more practice with the commandline instead of an IDE is certainly in order :wink: I tried the test application yesterday on my machine and it worked fine.
mark139 Posted May 13, 2005 Report Posted May 13, 2005 Hi, I'm sorry that I've (Mark Burton) been a bit use less in supporting the Java SDK I started. Many other projects and real work have got in the way. The java machine must be able to find the wrapper dll otherwise it will fail to load. The easiest way is to put the dll in the Windows PATH. The alternative is to include the path to the DLL when running java. Java and it's paths are very confusing at first. Cheers Mark
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now