Getting strange error in compilation

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting strange error in compilation

Kathryn Huxtable
Anyone else seen this?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project seaglasslookandfeel: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

This is code that used to work.

I'm running JDK 1.6.0_26 on Mac OS X 10.6.8 (Snow Leopard).

This is Maven 3.0.3.

-K
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
Okay, I see. Apple changed the location of classes.jar, which is what they call rt.jar in a recent release of Java, possibly update 26.

-K

On Jul 31, 2011, at 5:39 PM, Kathryn Huxtable wrote:

> Anyone else seen this?
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project seaglasslookandfeel: Compilation failure
> [ERROR] Failure executing javac, but could not parse the error:
> [ERROR] Fatal Error: Unable to find package java.lang in classpath or bootclasspath
>
> This is code that used to work.
>
> I'm running JDK 1.6.0_26 on Mac OS X 10.6.8 (Snow Leopard).
>
> This is Maven 3.0.3.
>
> -K
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Barrie Treloar
On Mon, Aug 1, 2011 at 8:23 AM, Kathryn Huxtable
<[hidden email]> wrote:
> Okay, I see. Apple changed the location of classes.jar, which is what they call rt.jar in a recent release of Java, possibly update 26.

How did you fix this then?

Do we need to configure maven to understand this natively?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
I've been working on a Swing pluggable look & feel, and was needing to include rt.jar. I have a separate profile for the Mac. The relevant sections of my pom look like:

...
<build>
        <plugins>
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>2.3.2</version>
                        <configuration>
                                <source>1.6</source>
                                <target>1.6</target>
                                <compilerArguments>
                                        <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
                                </compilerArguments>
                        </configuration>
                </plugin>
        </plugins>
...
<profiles>
        <profile>
                <id>mac</id>
                <activation>
                        <os>
                                <family>mac</family>
                        </os>
                </activation>
                <build>
                        <plugins>
                                <!-- Configure the compiler plugin to use JDK 1.6. -->
                                <plugin>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <version>2.3.2</version>
                                        <configuration>
                                                <source>1.6</source>
                                                <target>1.6</target>
                                                <compilerArguments>
                                                        <bootclasspath>${java.home}/bundle/Classes/classes.jar</bootclasspath>
                                                </compilerArguments>
                                        </configuration>
                                </plugin>
                        </plugins>
                </build>
        </profile>
...

I think most artifacts don't need to include rt.jar, so I don't know what you'd do. I suppose we can add the JDK version to the activation profile...

I don't think you folks need to do anything, but I was bewildered, and Google wasn't much help, though I did eventually find a solution through a Google search, just not the first several I tried.

-K

On Jul 31, 2011, at 6:27 PM, Barrie Treloar wrote:

> On Mon, Aug 1, 2011 at 8:23 AM, Kathryn Huxtable
> <[hidden email]> wrote:
>> Okay, I see. Apple changed the location of classes.jar, which is what they call rt.jar in a recent release of Java, possibly update 26.
>
> How did you fix this then?
>
> Do we need to configure maven to understand this natively?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K

On Jul 31, 2011, at 6:41 PM, Kathryn Huxtable wrote:

> I've been working on a Swing pluggable look & feel, and was needing to include rt.jar. I have a separate profile for the Mac. The relevant sections of my pom look like:
>
> ...
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <compilerArguments>
> <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
> </compilerArguments>
> </configuration>
> </plugin>
> </plugins>
> ...
> <profiles>
> <profile>
> <id>mac</id>
> <activation>
> <os>
> <family>mac</family>
> </os>
> </activation>
> <build>
> <plugins>
> <!-- Configure the compiler plugin to use JDK 1.6. -->
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <compilerArguments>
> <bootclasspath>${java.home}/bundle/Classes/classes.jar</bootclasspath>
> </compilerArguments>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>
> ...
>
> I think most artifacts don't need to include rt.jar, so I don't know what you'd do. I suppose we can add the JDK version to the activation profile...
>
> I don't think you folks need to do anything, but I was bewildered, and Google wasn't much help, though I did eventually find a solution through a Google search, just not the first several I tried.
>
> -K
>
> On Jul 31, 2011, at 6:27 PM, Barrie Treloar wrote:
>
>> On Mon, Aug 1, 2011 at 8:23 AM, Kathryn Huxtable
>> <[hidden email]> wrote:
>>> Okay, I see. Apple changed the location of classes.jar, which is what they call rt.jar in a recent release of Java, possibly update 26.
>>
>> How did you fix this then?
>>
>> Do we need to configure maven to understand this natively?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
I think the way for me to solve this is to use <file><exists>blah</exists></file> in two different profiles checking for the two different locations of classes.jar. If neither exists, we'll use the default profile, which points to the Windows/Linux location.

I assume that when Oracle actually releases a Mac Java, they will use the standard locations for these things rather than Apple's non-standard locations, but it's just an assumption. I'm not counting on anything, including that Oracle will even release a Mac Java. ;-)

-K

On Jul 31, 2011, at 6:44 PM, Kathryn Huxtable wrote:

> Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K
>
> On Jul 31, 2011, at 6:41 PM, Kathryn Huxtable wrote:
>
>> I've been working on a Swing pluggable look & feel, and was needing to include rt.jar. I have a separate profile for the Mac. The relevant sections of my pom look like:
>>
>> ...
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <version>2.3.2</version>
>> <configuration>
>> <source>1.6</source>
>> <target>1.6</target>
>> <compilerArguments>
>> <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
>> </compilerArguments>
>> </configuration>
>> </plugin>
>> </plugins>
>> ...
>> <profiles>
>> <profile>
>> <id>mac</id>
>> <activation>
>> <os>
>> <family>mac</family>
>> </os>
>> </activation>
>> <build>
>> <plugins>
>> <!-- Configure the compiler plugin to use JDK 1.6. -->
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <version>2.3.2</version>
>> <configuration>
>> <source>1.6</source>
>> <target>1.6</target>
>> <compilerArguments>
>> <bootclasspath>${java.home}/bundle/Classes/classes.jar</bootclasspath>
>> </compilerArguments>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> </profile>
>> ...
>>
>> I think most artifacts don't need to include rt.jar, so I don't know what you'd do. I suppose we can add the JDK version to the activation profile...
>>
>> I don't think you folks need to do anything, but I was bewildered, and Google wasn't much help, though I did eventually find a solution through a Google search, just not the first several I tried.
>>
>> -K
>>
>> On Jul 31, 2011, at 6:27 PM, Barrie Treloar wrote:
>>
>>> On Mon, Aug 1, 2011 at 8:23 AM, Kathryn Huxtable
>>> <[hidden email]> wrote:
>>>> Okay, I see. Apple changed the location of classes.jar, which is what they call rt.jar in a recent release of Java, possibly update 26.
>>>
>>> How did you fix this then?
>>>
>>> Do we need to configure maven to understand this natively?
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Barrie Treloar
In reply to this post by Kathryn Huxtable
On Mon, Aug 1, 2011 at 9:14 AM, Kathryn Huxtable
<[hidden email]> wrote:
> Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K

You know, I dont know.
You might be better starting a separate thread to ask that question.

My googling gets me contradictory answers.
http://www.google.com/search?q=maven+profile+activation

The POM reference docs (http://maven.apache.org/pom.html#Activation)
* Activation occurs when one or more of the specified criteria have
been met. When the first positive result is encountered, processing
stops and the profile is marked as active.

Introduction to Build Profiles
(http://maven.apache.org/guides/introduction/introduction-to-profiles.html)
* Doesn't have any examples that use multiple values within activation

Maven: The Complete Reference Section 5.3. Profile Activation
(http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html)
* Activations can contain one of more selectors including JDK
versions, Operating System parameters, files, and properties. A
profile is activated when all activation criteria has been satisfied.

So I suggest you try multiple and find out what happens.
Then we need to create a JIRA to fix the documentation...

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Benson Margulies
What do you get from:

find `/usr/libexec/java_home`/.. -name "classes.jar" -print

?

I get:


/Library/Java/JavaVirtualMachines/1.6.0_26-b03-384.jdk/Contents/Home/../Classes/classes.jar




On Sun, Jul 31, 2011 at 7:55 PM, Barrie Treloar <[hidden email]> wrote:

> On Mon, Aug 1, 2011 at 9:14 AM, Kathryn Huxtable
> <[hidden email]> wrote:
>> Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K
>
> You know, I dont know.
> You might be better starting a separate thread to ask that question.
>
> My googling gets me contradictory answers.
> http://www.google.com/search?q=maven+profile+activation
>
> The POM reference docs (http://maven.apache.org/pom.html#Activation)
> * Activation occurs when one or more of the specified criteria have
> been met. When the first positive result is encountered, processing
> stops and the profile is marked as active.
>
> Introduction to Build Profiles
> (http://maven.apache.org/guides/introduction/introduction-to-profiles.html)
> * Doesn't have any examples that use multiple values within activation
>
> Maven: The Complete Reference Section 5.3. Profile Activation
> (http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html)
> * Activations can contain one of more selectors including JDK
> versions, Operating System parameters, files, and properties. A
> profile is activated when all activation criteria has been satisfied.
>
> So I suggest you try multiple and find out what happens.
> Then we need to create a JIRA to fix the documentation...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
In reply to this post by Barrie Treloar
My test indicated that it's an "and/or". -K

On Jul 31, 2011, at 6:55 PM, Barrie Treloar wrote:

> On Mon, Aug 1, 2011 at 9:14 AM, Kathryn Huxtable
> <[hidden email]> wrote:
>> Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K
>
> You know, I dont know.
> You might be better starting a separate thread to ask that question.
>
> My googling gets me contradictory answers.
> http://www.google.com/search?q=maven+profile+activation
>
> The POM reference docs (http://maven.apache.org/pom.html#Activation)
> * Activation occurs when one or more of the specified criteria have
> been met. When the first positive result is encountered, processing
> stops and the profile is marked as active.
>
> Introduction to Build Profiles
> (http://maven.apache.org/guides/introduction/introduction-to-profiles.html)
> * Doesn't have any examples that use multiple values within activation
>
> Maven: The Complete Reference Section 5.3. Profile Activation
> (http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html)
> * Activations can contain one of more selectors including JDK
> versions, Operating System parameters, files, and properties. A
> profile is activated when all activation criteria has been satisfied.
>
> So I suggest you try multiple and find out what happens.
> Then we need to create a JIRA to fix the documentation...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Kathryn Huxtable
In reply to this post by Benson Margulies
I get:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/classes.jar

-K

On Jul 31, 2011, at 7:22 PM, Benson Margulies wrote:

> What do you get from:
>
> find `/usr/libexec/java_home`/.. -name "classes.jar" -print
>
> ?
>
> I get:
>
>
> /Library/Java/JavaVirtualMachines/1.6.0_26-b03-384.jdk/Contents/Home/../Classes/classes.jar
>
>
>
>
> On Sun, Jul 31, 2011 at 7:55 PM, Barrie Treloar <[hidden email]> wrote:
>> On Mon, Aug 1, 2011 at 9:14 AM, Kathryn Huxtable
>> <[hidden email]> wrote:
>>> Actually, can I require that a profile be activated when both a jdk version *and* an os family are selected, or is it always an "or" comparison? -K
>>
>> You know, I dont know.
>> You might be better starting a separate thread to ask that question.
>>
>> My googling gets me contradictory answers.
>> http://www.google.com/search?q=maven+profile+activation
>>
>> The POM reference docs (http://maven.apache.org/pom.html#Activation)
>> * Activation occurs when one or more of the specified criteria have
>> been met. When the first positive result is encountered, processing
>> stops and the profile is marked as active.
>>
>> Introduction to Build Profiles
>> (http://maven.apache.org/guides/introduction/introduction-to-profiles.html)
>> * Doesn't have any examples that use multiple values within activation
>>
>> Maven: The Complete Reference Section 5.3. Profile Activation
>> (http://www.sonatype.com/books/mvnref-book/reference/profiles-sect-activation.html)
>> * Activations can contain one of more selectors including JDK
>> versions, Operating System parameters, files, and properties. A
>> profile is activated when all activation criteria has been satisfied.
>>
>> So I suggest you try multiple and find out what happens.
>> Then we need to create a JIRA to fix the documentation...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Getting strange error in compilation

Mark Struberg
In reply to this post by Kathryn Huxtable
If I remember correctly, then this is also needed for native2ascii resource conversion. Anyone checking this?

LieGrue,
strub

--- On Sun, 7/31/11, Kathryn Huxtable <[hidden email]> wrote:

> From: Kathryn Huxtable <[hidden email]>
> Subject: Re: Getting strange error in compilation
> To: "Maven Users List" <[hidden email]>
> Date: Sunday, July 31, 2011, 11:41 PM
> I've been working on a Swing
> pluggable look & feel, and was needing to include
> rt.jar. I have a separate profile for the Mac. The relevant
> sections of my pom look like:
>
> ...
> <build>
>     <plugins>
>         <plugin>
>            
> <groupId>org.apache.maven.plugins</groupId>
>            
> <artifactId>maven-compiler-plugin</artifactId>
>            
> <version>2.3.2</version>
>            
> <configuration>
>            
>     <source>1.6</source>
>            
>     <target>1.6</target>
>            
>     <compilerArguments>
>            
>        
> <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
>            
>     </compilerArguments>
>            
> </configuration>
>         </plugin>
>     </plugins>
> ...
> <profiles>
>     <profile>
>        
> <id>mac</id>
>         <activation>
>            
> <os>
>            
>     <family>mac</family>
>            
> </os>
>         </activation>
>         <build>
>            
> <plugins>
>            
>     <!-- Configure the compiler plugin to
> use JDK 1.6. -->
>            
>     <plugin>
>            
>        
> <groupId>org.apache.maven.plugins</groupId>
>            
>        
> <artifactId>maven-compiler-plugin</artifactId>
>            
>        
> <version>2.3.2</version>
>            
>         <configuration>
>            
>            
> <source>1.6</source>
>            
>            
> <target>1.6</target>
>            
>            
> <compilerArguments>
>            
>            
>    
> <bootclasspath>${java.home}/bundle/Classes/classes.jar</bootclasspath>
>            
>            
> </compilerArguments>
>            
>        
> </configuration>
>            
>     </plugin>
>            
> </plugins>
>         </build>
>     </profile>
> ...
>
> I think most artifacts don't need to include rt.jar, so I
> don't know what you'd do. I suppose we can add the JDK
> version to the activation profile...
>
> I don't think you folks need to do anything, but I was
> bewildered, and Google wasn't much help, though I did
> eventually find a solution through a Google search, just not
> the first several I tried.
>
> -K
>
> On Jul 31, 2011, at 6:27 PM, Barrie Treloar wrote:
>
> > On Mon, Aug 1, 2011 at 8:23 AM, Kathryn Huxtable
> > <[hidden email]>
> wrote:
> >> Okay, I see. Apple changed the location of
> classes.jar, which is what they call rt.jar in a recent
> release of Java, possibly update 26.
> >
> > How did you fix this then?
> >
> > Do we need to configure maven to understand this
> natively?
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]