• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 66
  • Last Modified:

Problems attempting to compile java code

Any help would be greatly appreciated.  I'm attempting to compile sample code provided by Chase Paymentech.

The command that I'm running is "javac -classpath /home/danp/JPMC_MSDK_1.0.0/src ORBOnlineAuth.java".  I receive a bunch of errors saying that a bunch of packages don't exist.

The missing package messages include "error: org.apache.log4j does not exist".  I do have log4j, but it's located elsewhere on my server (not in org.apache).  

How can I point the compiler to  use log4j in the directory where it's already residing?

-Dan
0
Dan Packer
Asked:
Dan Packer
  • 3
  • 2
  • 2
3 Solutions
 
Martin MillerCTOCommented:
I found this solution applicable for using Eclipse:

configure the classpath and add the location of the log4j.properties files by clicking on: Run->Run Configuration -> [classpath tab] -> click on user Entries -> Advanced -> Select Add Folder -> select the location of your log4j.properties file
0
 
CEHJCommented:
You can start off with this:

javac .;<put the full path to the log4j jar here> ORBOnlineAuth.java

Open in new window

0
 
Dan PackerAuthor Commented:
Thanks CHEJ - I tried that, but I still get the same result - error: package org.apache.log4j does not exist.

I had to change the semicolon to a colon to get as far as I did.  I (think) I need the directory /home/mfg/danp/JPMC_MSDK_1.0.0/src in my classpath because the java code imports a bunch of packages under that directory.

Here's the command that I'm running with part of the result below.

[mfg@slsdev06 java]$ javac -classpath /apps/sas/2017ee/servers/tomcat/webapps/qadui/WEB-INF/lib:/home/mfg/danp/JPMC_MSDK_1.0.0/src ORBOnlineAuth.java
/home/mfg/danp/JPMC_MSDK_1.0.0/src/com/jpmc/cms/sdk/framework/core/DispatcherBase.java:5: error: package org.apache.log4j does not exist
import org.apache.log4j.Logger;
                       ^
/home/mfg/danp/JPMC_MSDK_1.0.0/src/com/jpmc/cms/sdk/framework/factory/DispatcherFactoryIF.java:8: error: package org.apache.log4j does not exist
import org.apache.log4j.Logger;
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
CEHJCommented:
I'm sorry. For some bizarre reason i thought you were using Windows. The path separator you need is of course the colon.
But as i mentioned, you need the full path (and filename) to the log4j jar in there

find /apps/sas/2017ee -name '*log4j*.jar'

Open in new window

might find it
0
 
Dan PackerAuthor Commented:
CEHJ - I still can't get it to compile.  Is it possible to ask you to troubleshoot directly?  And how much would that cost?

Thanks!
0
 
Dan PackerAuthor Commented:
Thanks - I had set up the environment incorrectly.  Thanks to CEHJ for his assistance!
0
 
Martin MillerCTOCommented:
Dan, Can I close this question?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now