• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating and using a simple Java class

Explorer ,
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

Views

579

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

I tried this example with CF10 and I have blank page, no any output. More details : I have created Employee, put as class into ..ColdFusion10\cfusion\wwwroot\uTube\jars\javaapp dir, set ColdFusion Class Path to this location through Administrator and start http://127.0.0.1/uTube/employee1.cfm / As a result, blank page without any output

But Employee object was found, no error about unknown class.

These examples are not appropriate for CF 10 or there is other reason?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

Did you do configuration like this in Application.cfc?

this.javaSettings = {LoadPaths = ["\uTube\jars\javaapp\"],loadColdFusionClassPath = "true", reloadOnChange= "true"};

Also, could you show us the Java code in employee1.cfm?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

LATEST

Java classes compiled on JDK1.7 cause this problem because CF10 itself is compiled against JDK1.6.

To solve the problem one needs to (write and) compile his Java classes against JDK1.6. This can be done with JDK1.7 using appropriate flags for compiler. An example:

javac -source 1.6 -target 1.6 Employee.java

It was mentioned though that future updates to CF10/9 would be build for JDK1.7 and in theory this should eliminate the problem.

The original thread can be found here: http://forums.adobe.com/message/4923366#4923366

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

may be, problem is in location of my custom . class? Where can I locate my classes?

Because only working ( for me) example is this one:

where used standard java.net.InetAddress class...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation