Skip to main content

Eclipse >> not compiling to correct java version

1 reply [Last post]
newm1ke
Offline
Joined: 2007-01-02
Points: 0

Hiya, I'm using Eclipse and am having a problem compiling and I am running low on ideas on how to fix it! This may be a long post as I'll try to be as detailed as I can..

Basically, I have a version of Eclipse and so does my co-worker (although he has a very slightly older version). I'm trying to build a program then upload the jar files online for an internet application.

Here's the problem - everytime I put the jar files up, the website can't find a page, it just has an error. What we think the problem is is that the site works with java 1.3 so maybe the files arent being compiled to that in eclipse. Everytime my co-worker builds the files they work fine when uploaded. So it must be my setup of eclipse!

However, we seem to have the same settings.. In the project properties, under java compiler I have:

Compiler compliance level: 3.1
generated class files compatibility : 1.1 (tried 1.3 too)
source compatibility: 1.3

Additionally, I have set the windows > properties to include a 1.3 Virtual Machine which the project is using.

And other identical settings relating to java jdk's. When I compile I also get a warning, where-as when my co-worker compiles he gets no warnings at all. My warning is:

Buildfile: C:\Projects\Connect\build\build.xml

classes:
[javac] Compiling 87 source files to C:\Projects\Connect\classes
[javac] C:\Projects\Connect\src\com\plk\data\PlkDatabases.java:94: warning: non-varargs call of varargs method with inexact argument type for last parameter;

[javac] cast to java.lang.Object for a varargs call
[javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning
[javac] dbid = (String) m.invoke(cl, null);
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning

Which I'd imagine points to some kind of difference in which java versions we are checking against.

To expand on the website side of things: There is a site loaded onto an oracle server, with various jsp pages. An index.jsp page loads by default. This page uses code from the jar file. The jar file does have some code to connect to a database and get some values, but if a connection is not established, some fields on the index page remain blank. The problem comes if I uploaded a seemingly identical jar (compiled by the version of eclipse i am running) in place of the existing jar, when the site address is typed in, it will no longer even load a page -- just a blank 'cant find page' error.

Any suggestions are appreciated. Thanks a lot

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
newm1ke
Offline
Joined: 2007-01-02
Points: 0

No responses but sorted it out via other sources. For other people with the problem, all you have to do is edit the build.xml for ant builder - within the tag add target="1.3" and source="1.3" and it will compile to 1.3. You can put any java version in there.