I am working on a project which runs on java 8, but I frequently use jasper reports which runs on java 7 for generating PDF reports. Problem is that I have to switch between the 7 & 8 versions for this. Is there any way I can let the system know which version of Java to use for which applications. My tomcat server is wrapped within a Hybris server instance which is run externally, so changing compliance level in Eclipse is of no help.
            Asked
            
        
        
            Active
            
        
            Viewed 322 times
        
    -2
            
            
        - 
                    but you need set the Environmental variables properly also need to select the default java version for every Java Applications you are working – Harisudhan. A Jul 01 '17 at 05:19
- 
                    I am doing the same and wondering if there is any way or hack so that I can work on both simultaneously. – sgX Jul 01 '17 at 21:04
2 Answers
0
            
            
        As per described here you can install any number of JDKs. The system default will be the one you added to the PATH variable under environment variables. When you create a new project in NetBeans select the desired JDK location. (Java 7 or Java8). You can refer this.
 
    
    
        Chathura Buddhika
        
- 2,067
- 1
- 21
- 35
- 
                    Please refer the extra info added to the question as I think my question is being misunderstood. – sgX Jul 01 '17 at 21:09
0
            Maybe my question was misunderstood, but I found a way to acheive what I intended to do. Set your JAVA_HOME to 1.7 version and open iReports application(it did not open if version is set to 1.8). Then reset JAVA_HOME back to 1.8 and run your application normally. Once iReports has started, there is no further issue while developing your reports. It is more of a hack than a proper solution, but works well enough for me.
 
    
    
        sgX
        
- 696
- 1
- 8
- 16
