Another update... After uploading the sapjco3.jar file into my local maven repository, I can successfully get my code to compile. After deploying this code to my linux tomcat server, I get an error something like "not allowed to rename jar file". Apparently this is a common problem with the sapjco3.jar file version 3.0.10 and above. Still looking for a solution to this.
Update... After adjusting the pom.xml file and changing the project compiler to java 1.8, I'm no longer getting the "bootstrap class path not set in conjunction with -source 1.6" error. However, I'm still getting "package com.sap.conn.jco does not exist" when compiling. Any other thoughts on what I need to do to get this jar file to show up when compiling?
Original message: I'm trying to get a Spring MVC application to compile using Maven in Spring Tool Suite, and I'm getting a 'bootstrap class path not set in conjunction with -source 1.6' error.
I'm using Spring Tool Suite 3.7.2 and I'm issuing Maven commands through the Spring Tool Suite content menus to do the clean, compile, install, and deploy commands (in other words, I'm not using Maven command line). The JRE System Library that is configured in the build path by default is JavaSE-1.6. I'm working with a Spring MVC framework application, and the java version in the pom.xml file is 1.6.
I've created a folder called 'lib' in the root of the project, and I've added a third party jar file (sapjco3.jar) to that folder. I've added that jar file to the build path of the project.
When I run the 'Maven compile' goal, I'm getting a compile error, and here is the top of the error:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bootstrap class path not set in conjunction with -source 1.6
C:\Users\user\Documents\workspace-sts- 3.7.2.RELEASE\JCOTest\src\main\java\com\graybar\jcotest\query\SAPDAO.java: [10,23] error: package com.sap.conn.jco does not exist
In the classes of my project where I'm referencing the code in the sapjco3.jar file, they are showing up just fine, and my code works just fine locally. However, to get my code to run locally, I had to add the windows version of the sapjco3 driver, sapjco3.dll, to the c:\windows\system32 folder on my workstation.
I suspect that my problem has to do with the sapjco3 code not being seen when compiling. I've tried adding both the sapjco3.jar and sapjco3.dll files to my jdk 1.6 lib folder, and I've added the same files to the lib folder in the jre folder for jdk 1.6.
I've also tried switching out java 1.6 for java 1.8 with no success.
Am I on the right track here regarding the sapjco3.jar code not being seen during the compile process? My end goal here is to deploy this code to a linux based version of tomcat 1.8.
Here is my complete pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.graybar</groupId>
<artifactId>jcotest</artifactId>
<name>JCOTest</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
Thanks!
-Stephen Spalding