3

I am trying to install UMLGraph to generate a .dot file from java class. I will be using this .dot file to feed to Graphviz(a PNG class diagram generator) . However, I am facing certian issues while the installation . The official UML installation guide umlgraph.org is woefully difficult to understand. Can someone please give manual steps to install and configure UMLGraph for windows ?

I have tried below things on my system :

  1. Installed JAVA JDK and JRE 7 in C:/Program Files.
  2. Downloaded the UMLGraph-5.7_2.3-SNAPSHOT.zip file from UMLGRAPH DOWNLOADS
  3. Created a new folder : D:/UMLGraph/
  4. Copied the entire "lib" and "bin" folder from the extracted .zip umlgraph file and pasted it in the folder created at step 3.
  5. Now , I changed the path of UMLGRAPH_HOME to = D:/UMLGraph/lib folder as suggested in the official website.
  6. Then I copied my UMLGraph.jar file to the location where I have my java related tools.jar file (at C:\Program Files\Java\jdk1.7.0_80\lib).
  7. Finally I tried to run the java -jar command as seen in the unofficial umlgraph instruction as belows :

    java -jar C:/Program Files/Java/jdk1.7.0_80/lib/UmlGraph.jar -all -private A.java

When I ran the above command,I got the error! "Unable to access JARFILE C:/PROGRAM"

Please let me know if I am doing something wrong.

UPDATE : Thanks a lot guys. Finally I installed jdk and jre 1.8 . There are no more java issues. I finally ran the below command : C:/Users/xyz > java -jar "C:/Program Files/Java/jdk1.8.0_60/lib/UmlGraph.jar" -all -private "D:/xyz/abcd/uml-parser-test-1/" .

The uml-parser-test-1 contains all about 5 .java files and I wish to create a single UML diagram out of them ( They are all linked to eachother in java code).

When I run above code , I get an error : UMLGRAPH ERROR - ILLEGAL PACKAGE NAME

So my final query is : How canI ask my UMLPARSER to generate a single diagram for all the underlying .java classes within a package ?

  • 1
    Have you tried `java -jar "C:/Program Files/Java/jdk1.7.0_80/lib/UmlGraph.jar" -all -private A.java`? – Buhake Sindi Sep 25 '15 at 08:51
  • @BuhakeSindi Yes Sir, I did that earlier. I got the error UNSUPPORTED CLASS VERSION ERROR : UNSUPPORTED major.minor.version 52.0 :( I guess this is due to java version error . But not sure though. – pronessssssssssss Sep 25 '15 at 08:56
  • 1
    That's because you are running the JAR in JDK 1.7 (JDK 8) whereas the project was built in JDK 1.8 (JDK 8). Download the latest Java 8 JDK and run the JAR using Java 8. Major.minor 52.0 means that the JDK/JRE is compiled using Java 8 SDK. – Buhake Sindi Sep 25 '15 at 09:00
  • THanks ! I uninstalled JDK 7 and installed the JDK 1.8.60 . I ended up getting this : " A JNI ERROR HAS OCCURED. PLEASE CHECK INSTALLATION" TO be noted that this time there was no tools.jar file in the jdk folder. – pronessssssssssss Sep 25 '15 at 09:46
  • Maybe there is something wrong with your JDK installation? Mine has C:\Program Files\Java\jdk1.8.0_20\lib\tools.jar. – Diomidis Spinellis Sep 25 '15 at 10:15
  • DiomidisSpinellis and @BuhakeSindi Please check the updated eidt in the last section of my question. I am not able to add comments with code here. Thanks guys ! :) – pronessssssssssss Sep 25 '15 at 21:01

0 Answers0