Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Bootclasspath?
Bootclasspath? [message #258001] Fri, 09 January 2009 02:22 Go to next message
Eclipse UserFriend
Hi,

this question is not directly related to the Eclipse IDE. I've got to
mantain a Java tool that uses JDT to compile some sources, both 1.4 and
1.5, and should be run using a Java 5 runtime.
I have some issues when compiling 1.4 sources (targetting 1.4 platform): I
set the properties org.eclipse.jdt.core.compiler.compliance,
org.eclipse.jdt.core.compiler.source and
org.eclipse.jdt.core.compiler.codegen.targetPlatform to 1.4 so I was able
to compile the code, but now I have a runtime error (invalid BigDecimal
constructor). I suspect this is because JDT compiles against the Java 5
runtime libraries.
Is there any property I can set to force JDT to compile against another
runtime? A sort of "bootclasspath" that I should use with javac.

Thank you.

Regards,

Andrea Bianchi
Re: Bootclasspath? [message #258009 is a reply to message #258001] Fri, 09 January 2009 08:46 Go to previous messageGo to next message
Eclipse UserFriend
andrea bianchi a écrit :
> this question is not directly related to the Eclipse IDE. I've got to
> mantain a Java tool that uses JDT to compile some sources, both 1.4 and
> 1.5, and should be run using a Java 5 runtime.
> I have some issues when compiling 1.4 sources (targetting 1.4 platform):
> I set the properties org.eclipse.jdt.core.compiler.compliance,
> org.eclipse.jdt.core.compiler.source and
> org.eclipse.jdt.core.compiler.codegen.targetPlatform to 1.4 so I was
> able to compile the code, but now I have a runtime error (invalid
> BigDecimal constructor). I suspect this is because JDT compiles against
> the Java 5 runtime libraries. Is there any property I can set to force
> JDT to compile against another runtime? A sort of "bootclasspath" that I
> should use with javac.
This means that you are using 1.5 types/methods/fields inside your code.
So even if you target 1.4 (changing the source/compliance/target
platform values), you still referenced members that are available only
in 1.5.

If you have a bundle, you can set up Api Tools for your project in order
to detect these kinds of invalid references.
--
Olivier
Re: Bootclasspath? [message #258013 is a reply to message #258001] Fri, 09 January 2009 09:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 1/9/2009 2:22 AM, andrea bianchi wrote:
> Hi,
>
> this question is not directly related to the Eclipse IDE. I've got to
> mantain a Java tool that uses JDT to compile some sources, both 1.4 and
> 1.5, and should be run using a Java 5 runtime.
> I have some issues when compiling 1.4 sources (targetting 1.4 platform):
> I set the properties org.eclipse.jdt.core.compiler.compliance,
> org.eclipse.jdt.core.compiler.source and
> org.eclipse.jdt.core.compiler.codegen.targetPlatform to 1.4 so I was
> able to compile the code, but now I have a runtime error (invalid
> BigDecimal constructor). I suspect this is because JDT compiles against
> the Java 5 runtime libraries. Is there any property I can set to force
> JDT to compile against another runtime? A sort of "bootclasspath" that I
> should use with javac.

In addition to setting the compiler compliance, you should also be
setting the JRE Lib to a 1.4 JRE/JDK. that is easy to do in the IDE
(Project Properties > Java Build Path > Libraries tab), but I'm not sure
how you are setting those kinds of things non-interactively.

Hope this helps,
Eric
Re: Bootclasspath? [message #258067 is a reply to message #258013] Tue, 13 January 2009 02:37 Go to previous message
Eclipse UserFriend
Thank you for your answers... in the meanwhile I decided to rewrite that
module of the application avoiding jdt to compile classes.

Thank you again,

Andrea
Previous Topic:Duplicate conflicting class definitions in different files gives confusing error messages in client
Next Topic:IPackageFragment's getCompilationUnit is buggy
Goto Forum:
  


Current Time: Sat Apr 26 11:42:19 EDT 2025

Powered by FUDForum. Page generated in 0.03746 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top