Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile on a Mac with java 12 #38

Open
rjlouro opened this issue Sep 26, 2019 · 2 comments
Open

Cannot compile on a Mac with java 12 #38

rjlouro opened this issue Sep 26, 2019 · 2 comments

Comments

@rjlouro
Copy link

rjlouro commented Sep 26, 2019

Trying to compile MTS on a macbook pro and run into 2 problems:

Package javax.cml.bind does not exist:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project mts: Compilation failure: Compilation failure:
[ERROR] /Users/rjlouro/Documents/WIT/RCS/MTS_Git/mts/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/operators/PluggableParameterOperatorBinary.java:[66,21] error: package javax.xml.bind does not exist
[ERROR] /Users/rjlouro/Documents/WIT/RCS/MTS_Git/mts/src/main/java/com/devoteam/srit/xmlloader/core/operations/basic/operators/PluggableParameterOperatorBinary.java:[478,34] error: cannot find symbol

Solved by adding it to pom.xml. Tried version 2.3.0 and it worked.

--- a/pom.xml
+++ b/pom.xml
@@ -538,5 +538,10 @@
             <scope>system</scope>
             <systemPath>${basedir}/lib/jpcap.jar</systemPath>
         </dependency>
+       <dependency>
+               <groupId>javax.xml.bind</groupId>
+               <artifactId>jaxb-api</artifactId>
+               <version>2.3.0</version>
+       </dependency>
     </dependencies>
 </project>

Build fails with incompatible type

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project mts: Compilation failure: Compilation failure:
[ERROR] /Users/rjlouro/Documents/WIT/RCS/MTS_Git/mts/src/main/java/com/devoteam/srit/xmlloader/gui/model/ModelTreeRTStats.java:[251,77] error: incompatible types: Enumeration<TreeNode> cannot be converted to Enumeration<DefaultMutableTreeNode>
[ERROR] /Users/rjlouro/Documents/WIT/RCS/MTS_Git/mts/src/main/java/com/devoteam/srit/xmlloader/gui/model/ModelTreeRTStats.java:[302,77] error: incompatible types: Enumeration<TreeNode> cannot be converted to Enumeration<DefaultMutableTreeNode>

Solved by the following changes:

--- a/src/main/java/com/devoteam/srit/xmlloader/gui/model/ModelTreeRTStats.java
+++ b/src/main/java/com/devoteam/srit/xmlloader/gui/model/ModelTreeRTStats.java
@@ -248,7 +248,7 @@ public class ModelTreeRTStats extends DefaultTreeModel {
         boolean alreadyExist = false;

         // We get all children of node parent
-        Enumeration<DefaultMutableTreeNode> allChildren = nodeParent.children();
+        Enumeration allChildren = nodeParent.children();

         // For each child
         while (allChildren.hasMoreElements()) {
@@ -298,12 +298,12 @@ public class ModelTreeRTStats extends DefaultTreeModel {
         DefaultMutableTreeNode node = null;

         // We get all children of node parent
-        Enumeration<DefaultMutableTreeNode> allChildren = nodeParent.children();
+        Enumeration allChildren = nodeParent.children();

         // For each child
         while (allChildren.hasMoreElements()) {
             // Get the current child
-            node = allChildren.nextElement();
+            node = (DefaultMutableTreeNode) allChildren.nextElement();

             // If this child match (with the name) with the node searching
             if (node.toString().equals(nodeChild.toString())) {

My environment:

MacOS Mojave 10.14.6 

java 12.0.2 2019-07-16
Java(TM) SE Runtime Environment (build 12.0.2+10)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)
@egwepas
Copy link
Contributor

egwepas commented Oct 14, 2019

Hello, thanks for the feedback, we'll address that as soon as possible.

The current reference Java version is (still) 8.

@tnmtechnologies
Copy link

It would be nice to use the maven toolchains plugin (https://maven.apache.org/plugins/maven-toolchains-plugin/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants